Create the GitHub Actions workflow file that runs the fast test suite on every PR and push, and the live Claude test suite on pushes to main only. The live job depends on the fast job succeeding, and injects ANTHROPIC_API_KEY from repository secrets.
Requirements
- Create
.github/workflows/ci.yml with two jobs:
test job: triggers on pull_request (all branches) and push to main; runs npm ci, npm run typecheck, npm test; Node 20; timeout-minutes: 5; caches node_modules via actions/setup-node cache
test-live job: triggers on push to main only (if: github.event_name == 'push' && github.ref == 'refs/heads/main'); needs: test (does not run if fast tests fail); runs npm ci, npm run test:live; injects ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}; timeout-minutes: 10
test-live job must exit 0 when ANTHROPIC_API_KEY secret is not configured (live tests skip gracefully, do not fail the job)
continue-on-error: false for the test-live job — live test failures on main are a blocking signal
- No
workflow_dispatch trigger (can be added later)
- Document (in PR description or commit message) that
ANTHROPIC_API_KEY must be added to repository secrets as a manual one-time step
Design Guidance
Implements the 'CI Architecture' section of the architecture design. The two-job structure, needs: test dependency, secret names, timeout values, and Node version are all specified in the architecture's workflow YAML design. The rationale for not including CLAUDE_CODE_OAUTH_TOKEN in CI initially is also documented in the architecture.
Acceptance Criteria
Dependencies
Phase 1, Phase 3
Create the GitHub Actions workflow file that runs the fast test suite on every PR and push, and the live Claude test suite on pushes to main only. The live job depends on the fast job succeeding, and injects
ANTHROPIC_API_KEYfrom repository secrets.Requirements
.github/workflows/ci.ymlwith two jobs:testjob: triggers onpull_request(all branches) andpushtomain; runsnpm ci,npm run typecheck,npm test; Node 20;timeout-minutes: 5; cachesnode_modulesviaactions/setup-nodecachetest-livejob: triggers onpushtomainonly (if: github.event_name == 'push' && github.ref == 'refs/heads/main');needs: test(does not run if fast tests fail); runsnpm ci,npm run test:live; injectsANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }};timeout-minutes: 10test-livejob must exit 0 whenANTHROPIC_API_KEYsecret is not configured (live tests skip gracefully, do not fail the job)continue-on-error: falsefor thetest-livejob — live test failures on main are a blocking signalworkflow_dispatchtrigger (can be added later)ANTHROPIC_API_KEYmust be added to repository secrets as a manual one-time stepDesign Guidance
Implements the 'CI Architecture' section of the architecture design. The two-job structure,
needs: testdependency, secret names, timeout values, and Node version are all specified in the architecture's workflow YAML design. The rationale for not includingCLAUDE_CODE_OAUTH_TOKENin CI initially is also documented in the architecture.Acceptance Criteria
.github/workflows/ci.ymlexists and is valid YAMLtestjob (nottest-live)maintriggers both jobs, withtest-livewaiting fortestto passtestjob completes within 5 minutes on a clean runnertest-livejob completes within 10 minutesANTHROPIC_API_KEYsecret is absent,test-livejob exits 0 (skipped tests, no failure)node_modulesis cached between workflow runs on the same branchDependencies
Phase 1, Phase 3