Organize CI build and validation into pre-build, build, and post-build#29177
Organize CI build and validation into pre-build, build, and post-build#29177mvvmm wants to merge 4 commits intoproductionfrom
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
/bonk please review |
|
This PR effectively restructures the CI pipeline to provide faster feedback on lint/format/test failures. The logic is sound - splitting tests based on their One issue to address: The
The Suggestion: Either remove the Everything else looks good:
|
|
Preview URL: https://f48a8835.preview.developers.cloudflare.com |
6ea9dcb to
f48a883
Compare
| run: npm ci | ||
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | ||
|
|
||
| - uses: actions/cache@v5 |
There was a problem hiding this comment.
| - uses: actions/cache@v5 | |
| - name: Restore Astro assets from cache | |
| - uses: actions/cache@v5 |
Summary
What changed
The CI pipeline had a
build+validatestructure where lint, formatting, and test failures were only surfaced after waiting 20+ minutes for the build to complete. This restructures the pipeline into three explicit phases.New job topology
Changes at a glance
pre-build(new): All fast validation steps that do not require a builtdist/move here — CRLF check, file extension check, type checking, ESLint, format check, redirect validation, and Node/Astro tests (test:prebuild). Failures surface in ~2-3 minutes instead of after the full build.build: Nowneeds: pre-build. Stripped of all steps moved topre-build— responsible only for runningnpm run buildand uploading thedist/artifact.post-build(renamed fromvalidate): Runs afterbuild. Downloads thedist/artifact, runs the Workers test suite (test:postbuild) which requiresdist/to exist, then surfaces any link validation failures.notify: Updatedneedsto[pre-build, build, post-build]and job name filters updated to match new names.compile: Untouched (pending separate removal).publish-preview: Untouched.Why tests are split
The Workers vitest pool reads
wrangler.tomlat startup, which specifiesassets.directory = "./dist". Running all tests inpre-buildcaused an immediate crash sincedist/doesn't exist yet. Two scripts were added topackage.json—test:prebuild(Node + Astro suites) andtest:postbuild(Workers suite) — to split them across the appropriate phases.