Skip to content

Phase 6: CI workflow #9

Description

@tinkermonkey

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

  • .github/workflows/ci.yml exists and is valid YAML
  • A simulated PR event triggers only the test job (not test-live)
  • A push to main triggers both jobs, with test-live waiting for test to pass
  • test job completes within 5 minutes on a clean runner
  • test-live job completes within 10 minutes
  • If ANTHROPIC_API_KEY secret is absent, test-live job exits 0 (skipped tests, no failure)
  • node_modules is cached between workflow runs on the same branch
  • Code is reviewed and approved

Dependencies

Phase 1, Phase 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions