Repository navigation
[AI:zf-builder] test: add a GitHub Actions CI pipeline to enforce the typecheck, build, and regression-guard test gates - #141
Conversation
…d, and regression-guard test gates Task: zf-zs-e6a4b699 Add a GitHub Actions CI pipeline to enforce the typecheck, build, and regression-guard test gates
…d, and regression-guard test gates Task: zf-zs-e6a4b699 Add a GitHub Actions CI pipeline to enforce the typecheck, build, and regression-guard test gates
ntsd
left a comment
There was a problem hiding this comment.
[AI:zf-reviewer] [Reviewer Feedback] Round 1: Approved for human review.
Scope: PR adds .github/workflows/ci.yml (57 lines) + a regression guard tests/ci-pipeline.test.mjs (204 lines). Exactly the P1 fix requested — a minimal CI pipeline enforcing the gates that only the locally-installed, bypassable pre-commit hook enforced. No unrelated churn, no drive-by reformatting (Rung 7 clean).
Ponytail 7-Rung checks:
- No new dependencies. The guard resolves
js-yamlviacreateRequirefrom the lockfile (transitive dep of astro) instead of adding a devDep — correct call, matches the repo convention of not adding deps for tests. - Workflow is minimal: single job, 4 gate steps + checkout/setup-node, least-privilege
permissions: contents: read, no matrix/strategy/caching beyondcache: npm. astro checkcorrectly NOT included per the task constraint (@astrojs/checkis not a devDep and its install prompt hangs non-interactive shells).- The guard test follows the repo's static-source-guard convention: top-level asserts over
readFileSync, no framework, re-derives the test-file count instead of hard-coding a stale number.
Gate correctness (cross-checked against .zerofactory/precommit.sh):
- Triggers:
push: branches: [main]+pull_request— matches the task spec. - Order:
npm ci→npx tsc --noEmit→npm run build→npm test, mirroring the pre-commit hook (typecheck before build, tests last). node-version: 22satisfiesengines.node >= 22.18(tracks latest 22.x patch); the guard cross-references the major against the package.json floor.- Guard cross-references
scripts.buildagainstastro buildandscripts.testagainstnode --test "tests/*.test.mjs", so a future stub-swap of the package.json scripts fails CI. Good depth without over-engineering.
Verified in workspace (all green):
npx tsc --noEmit— passnpm run build(astro build) — pass, 2 pages builtnpm test— 66/66 pass, including the newtests/ci-pipeline.test.mjs(also passes in isolation)npm run lint(prettier --check + eslint) — passpackage-lock.jsonpresent, sonpm ciwill work in CI- PR is MERGEABLE against
main; no existing review rounds on this commit
GOTCHA: In zero-share CI/workflow regression guards, js-yaml is only a transitive dep of astro — resolve it via createRequire(import.meta.url) rather than adding a direct devDep; also the on: key parses as YAML-boolean true under js-yaml (YAML 1.1), so normalize with workflow.on ?? workflow[true] before trigger assertions.
[AI:zf-builder] Task: zf-zs-e6a4b699
Add a GitHub Actions CI pipeline to enforce the typecheck, build, and regression-guard test gates
Automated PR for task zf-zs-e6a4b699
Completed by: @zf-builder