Files
kilo-cv/docs/plans/2026-02-23-ci-parallelization-design.md

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

  1. Remove lighthouse dependency - currently waits for frontend unnecessarily
  2. Upload frontend artifact - frontend job uploads dist/
  3. Download artifact in test jobs - integration, e2e, regression download instead of rebuilding
  4. Split quality job into 3 parallel jobs:
    • coverage - runs tests with coverage, uploads to Codecov
    • bundle-size - checks bundle size limits
    • security - 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:

  1. lint - runs npm run lint
  2. frontend-test - runs npm run test:run
  3. backend-test - runs backend npm test
  4. build - waits for lint + tests, uploads dist artifact
  5. release - semantic-release (waits for build)
  6. docker - unchanged, waits for release

Job graph:

lint ──────────┐
frontend-test ─┼──► build ──► release ──► docker
backend-test ──┘

staging.yml

Split into 2 jobs:

  1. test - lint + frontend tests + backend tests in parallel steps
  2. deploy - waits for test, builds and pushes docker

Job graph:

test ──► deploy

nightly.yml

Split into 2 jobs:

  1. build - builds frontend, uploads artifact
  2. docker - waits for build, pushes docker image

Job graph:

build ──► docker

Implementation Notes

  • Use actions/upload-artifact@v4 and actions/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