2.7 KiB
2.7 KiB
CI Parallelization Design
Overview
Parallelize GitHub Actions workflows to reduce total CI time by running independent tasks concurrently and sharing build artifacts between jobs.
Scope
- ci.yml
- release.yml
- staging.yml
- nightly.yml
Approach
Use artifact sharing to avoid redundant builds. Frontend build artifacts are uploaded once and downloaded by dependent jobs.
Design
ci.yml
- Remove lighthouse dependency - currently waits for frontend unnecessarily
- Upload frontend artifact -
frontendjob uploadsdist/ - Download artifact in test jobs -
integration,e2e,regressiondownload instead of rebuilding - Split quality job into 3 parallel jobs:
coverage- runs tests with coverage, uploads to Codecovbundle-size- checks bundle size limitssecurity- runs npm audit
Job graph:
commitlint ──────┐
frontend ────────┼──► integration
backend ─────────┤
├──► e2e
├──► regression
│
lighthouse ──────┘ (parallel, no deps)
coverage ──────── (parallel)
bundle-size ───── (parallel)
security ──────── (parallel)
release.yml
Split monolithic job into parallel jobs:
- lint - runs npm run lint
- frontend-test - runs npm run test:run
- backend-test - runs backend npm test
- build - waits for lint + tests, uploads dist artifact
- release - semantic-release (waits for build)
- docker - unchanged, waits for release
Job graph:
lint ──────────┐
frontend-test ─┼──► build ──► release ──► docker
backend-test ──┘
staging.yml
Split into 2 jobs:
- test - lint + frontend tests + backend tests in parallel steps
- deploy - waits for test, builds and pushes docker
Job graph:
test ──► deploy
nightly.yml
Split into 2 jobs:
- build - builds frontend, uploads artifact
- docker - waits for build, pushes docker image
Job graph:
build ──► docker
Implementation Notes
- Use
actions/upload-artifact@v4andactions/download-artifact@v4 - Artifact retention: 1 day (sufficient for workflow duration)
- No changes to actual test/build logic, only workflow structure
Implementation Complete
- Task 1: ci.yml lighthouse parallelization and artifact sharing
- Task 2: ci.yml quality job split into parallel jobs
- Task 3: release.yml parallel lint, frontend-test, backend-test, build, release
- Task 4: staging.yml split into test and deploy jobs
- Task 5: nightly.yml split into build and docker jobs