From fea7cfd28e994ea2908e2f6616124b3ecc3e6835 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 09:57:30 +0000 Subject: [PATCH] Add CI: tests and static analysis on push/PR Add a GitHub Actions workflow that runs the project's existing quality gates on push to main and on pull requests: - static-analysis: tsc --noEmit (strict) and a generated-types drift check that fails if src/generated is out of date with the schema (generated files are committed and must never be hand-edited) - test: vitest (npm test) Uses Node 22 with npm cache; concurrency cancels superseded runs. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01UFPpc84i8VimSTnWwGkBfW --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..15dddb7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +# Cancel superseded runs on the same ref to save CI minutes. +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + static-analysis: + name: Static analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Type-check (tsc --noEmit, strict) + run: npm run typecheck + + - name: Generated types are in sync with the schema + run: | + npm run gen + if ! git diff --exit-code -- src/generated; then + echo "::error::src/generated is out of date. Run 'npm run gen' and commit the result." + exit 1 + fi + + test: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run tests (vitest) + run: npm test