Skip to content

Run lint, test and build as parallel CI jobs behind a backend aggregator - #879

Merged
WaylandYang merged 1 commit into
devfrom
ci/parallel-lint-build
Sep 23, 2026
Merged

WaylandYang merged 1 commit into
devfrom
ci/parallel-lint-build

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Follow-up to #872 and #873.

Why

After the cache fix (#873) the backend job takes ~332s, of which Clippy (36s) and Build (39s) sit on the critical path for no reason: clippy is a check-mode build and cargo build is non-test codegen, neither shares artifacts with the test build. Without a cache hit they cost 143s and 51s.

What

backend is split into three parallel jobs, lint (fmt + clippy), test (Postgres service, migrate, cargo test --workspace) and build, each restoring the dev cache under its own job-id key and saving only on push, as before.

backend stays as an aggregator job with needs: [lint, test, build] and if: always(), failing unless all three succeeded. Branch protection on dev requires the checks named backend and web; renaming the job would silently drop clippy and build out of the merge gate. The aggregator keeps the required check name meaningful without touching protection settings.

Workflow-level permissions: contents: read untouched.

Expected effect

Critical path becomes the test job: ~30s setup + 14s migrate + ~184s test ≈ 4 min, versus ~5.5 min today. lint and build each take about a minute on a warm cache. First run after merge is cold for the new lint and build job keys until the dev push saves them.

Verification

YAML parsed and job graph checked locally (lint, test, build independent; backend needs all three). This PR's own run exercises the new layout; it will also show the aggregator's result line.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <145302500+WaylandYang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant