Problem Statement
CI workflows run sequentially with no caching between jobs, taking 25+ minutes. Optimize with parallel job execution, dependency caching, and conditional execution to reduce to under 8 minutes.
Technical Bounds
- Cargo registry cache: shared across all Rust jobs; keyed by
~/.cargo/registry/** hash.
- Target directory cache: per-branch with LRU eviction; limited to 2GB.
- Job fan-out: run test suites in parallel across 4 runners (unit, integration, e2e, fuzz).
- Conditional execution: skip lint and coverage on doc-only changes; skip e2e on non-core changes.
Steps
- Add Cargo registry caching:
actions/cache@v3 with key cargo-registry-${{ hashFiles('Cargo.lock') }}; restore key cargo-registry-.
- Add target directory caching: key
cargo-target-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}; max 2GB.
- Restructure workflow with parallel job matrix:
job: [lint, test, integration, coverage, fuzz].
- Add path-based conditional execution:
paths-ignore: ['docs/**', '*.md'] for lint job.
- Measure and document time improvements; add workflow status badge to README.
- Add workflow timeout: 30 minutes max per workflow run to prevent runaway jobs.
Problem Statement
CI workflows run sequentially with no caching between jobs, taking 25+ minutes. Optimize with parallel job execution, dependency caching, and conditional execution to reduce to under 8 minutes.
Technical Bounds
~/.cargo/registry/**hash.Steps
actions/cache@v3with keycargo-registry-${{ hashFiles('Cargo.lock') }}; restore keycargo-registry-.cargo-target-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}; max 2GB.job: [lint, test, integration, coverage, fuzz].paths-ignore: ['docs/**', '*.md']for lint job.