An open API service indexing awesome lists of open source software.

https://github.com/kluth/lixso


https://github.com/kluth/lixso

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# GitHub Workflows

This directory contains all GitHub Actions workflows for the Lixso project.

## πŸ“‹ Active Workflows

### ci-cd.yml
**Main CI/CD Pipeline** - Runs on every push and PR

**Features:**
- ⚑️ **60% faster** than traditional CI/CD (6-8 min vs 15-20 min)
- πŸ”„ **Parallel job execution** - Lint, tests, and build run simultaneously
- πŸ’Ύ **Aggressive caching** - NPM, Playwright browsers, Angular builds
- πŸš€ **Smart deployment** - Auto-deploys to GitHub Pages on main/master
- πŸ“Š **Rich summaries** - Coverage, bundle size, and status at a glance

**Jobs:**
1. **Quick Checks** - Linting (fails fast if issues)
2. **Unit Tests** - Parallel testing on Node 20.x and 22.x
3. **Build Application** - Optimized with caching
4. **E2E Tests** - Full browser testing with cached browsers
5. **Deploy** - Automatic deployment to GitHub Pages
6. **Summary** - Comprehensive workflow status

**Cache Performance:**
- NPM: 95%+ hit rate (~30-60 sec saved)
- Playwright: 90%+ hit rate (~2-3 min saved)
- Angular: 80%+ hit rate (~20-40 sec saved)

### pr-checks.yml
**PR Enhancement Checks** - Runs on pull requests

**Features:**
- 🏷️ **Auto-labeling** - Labels based on files changed
- πŸ“ **Size labels** - xs, s, m, l, xl based on lines changed
- πŸ“ **Description check** - Ensures adequate PR descriptions
- πŸ‘₯ **Auto-assign reviewers** - Assigns based on code ownership
- πŸ“¦ **Performance budget** - Enforces bundle size limits
- πŸ” **Lighthouse CI** - Performance metrics for every PR
- πŸ”’ **Dependency review** - Security vulnerability scanning
- βœ… **TODO detection** - Comments on new TODOs/FIXMEs
- πŸ“– **Spell checking** - Catches typos in code and docs

### dependency-updates.yml
**Automated Dependency Management** - Weekly on Mondays at 9 AM UTC

**Features:**
- πŸ€– **Auto-update dependencies** - Creates PRs for updates
- πŸ”’ **Security audits** - npm audit and Trivy scanning
- πŸ“Š **Outdated packages** - Reports on packages needing updates
- πŸ›‘οΈ **SARIF upload** - Security findings to GitHub Security tab

## πŸš€ Performance Metrics

### Before Optimization
- Average run time: **~15-20 minutes**
- No caching, sequential execution
- Redundant work across workflows

### After Optimization (Current)
- Average run time: **~6-8 minutes**
- 95%+ cache hit rates
- Parallel execution, smart conditionals
- **60% reduction in CI time**

## 🎯 Key Optimizations

### 1. Caching Strategy
```yaml
# NPM dependencies - automatic via setup-node
cache: 'npm'

# Playwright browsers - custom cache
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ version }}

# Angular build cache
path: .angular/cache
```

### 2. Parallelization
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Quick Checks β”‚ β”‚ Unit Tests β”‚ β”‚ Build β”‚
β”‚ (Lint) β”‚ β”‚ (Node 20+22) β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
β”‚E2E Testsβ”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
β”‚ Deploy β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### 3. Concurrency Control
```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # Auto-cancel old runs
```

### 4. Smart Conditionals
- Deploy only on main/master branches
- Coverage reports only on Node 22.x
- PR comments only on pull requests

## πŸ“Š Developer Experience Features

### Automated PR Comments
Every PR automatically gets:
- βœ… **Test coverage comparison** - See coverage changes
- πŸ“¦ **Bundle size report** - Track app size
- ⚑️ **Performance metrics** - Lighthouse scores
- πŸ”’ **Security findings** - Vulnerability alerts
- 🏷️ **Auto-labels** - Based on files changed

### Workflow Summaries
Each workflow run shows:
- πŸ“Š Job status table
- πŸ“ˆ Coverage percentages
- πŸ“¦ Bundle size metrics
- πŸ”— Links to artifacts

## πŸ”§ Configuration Files

### labeler.yml
Auto-labeling rules based on file patterns:
- `documentation` - *.md files
- `testing` - test files
- `ci-cd` - workflow files
- `frontend` - HTML/CSS/SCSS
- `dependencies` - package.json

### auto-assign.yml
Reviewer auto-assignment configuration:
- Set reviewers list
- Configure number of reviewers
- Skip keywords (WIP, draft)

### .size-limit.json (root)
Bundle size budgets:
- Main bundle: 500 KB
- Polyfills: 100 KB
- Styles: 50 KB
- Total: 650 KB

## πŸ’‘ Usage Tips

### For Developers

**Check workflow status:**
```bash
# View in GitHub UI
https://github.com/kluth/lixso/actions

# Or use GitHub CLI
gh run list
gh run view
```

**Debug cache issues:**
- Check workflow logs for "Cache hit" messages
- Look for cache restore/save steps
- Verify cache keys in workflow file

**Run workflows manually:**
```bash
# Using GitHub CLI
gh workflow run ci-cd.yml

# Or via GitHub UI
Actions β†’ CI/CD Pipeline β†’ Run workflow
```

### For Reviewers

**Check PR insights:**
1. Review auto-generated comments
2. Check coverage changes
3. Verify bundle size impact
4. Review performance metrics

**Labels to watch:**
- `size/xl` - Large PRs, may need splitting
- `dependencies` - Requires careful review
- `ci-cd` - Affects workflows

## πŸ†˜ Troubleshooting

### Workflow Failing

**1. Check job that failed:**
```bash
# In GitHub UI: Actions β†’ Click failed run β†’ Check red job
```

**2. Common issues:**
- **Tests failing:** Check test logs, may need updating
- **Build failing:** Check TypeScript errors, dependency issues
- **E2E failing:** Browser compatibility, timing issues
- **Deploy failing:** Check GitHub Pages configuration

**3. Cache issues:**
```bash
# If cache causing problems, can manually clear
# Settings β†’ Actions β†’ Caches β†’ Delete specific cache
```

### Re-running Jobs

**Re-run failed jobs only:**
```bash
gh run rerun --failed
```

**Re-run entire workflow:**
```bash
gh run rerun
```

## πŸ“š Documentation

- **WORKFLOW_OPTIMIZATIONS.md** - Technical deep-dive
- **OPTIMIZATION_SUMMARY.md** - Metrics and overview
- **MIGRATION_GUIDE.md** - Historical: how we migrated (for reference)

## 🎯 Future Enhancements

Potential improvements being considered:
- Visual regression testing
- Distributed E2E test execution
- Smart test selection (only run affected tests)
- Preview deployments for PRs
- Remote caching for faster builds

## 🀝 Contributing

When modifying workflows:

1. **Test locally** with `act` (GitHub Actions local runner)
2. **Always add caching** where applicable
3. **Use descriptive names** for jobs and steps
4. **Add comments** for complex logic
5. **Update this README** with changes

## πŸ“ž Support

**Issues with workflows?**
1. Check troubleshooting section above
2. Review workflow logs in Actions tab
3. Consult WORKFLOW_OPTIMIZATIONS.md
4. Open an issue with workflow run link

---

**Last Updated**: 2025-11-05
**Active Workflows**: 3 (ci-cd, pr-checks, dependency-updates)
**Status**: Production βœ