From 5b021d7ef23662b049330d2448cf335a4d8f6bfc Mon Sep 17 00:00:00 2001 From: lauren Date: Wed, 24 Jun 2026 18:45:22 -0500 Subject: [PATCH] ci: add PR build/test guard Runs npm ci + type-check + test + build on every PR to main, mirroring the Pages deploy. Catches a broken build, failing tests, or a platform-incomplete package-lock.json before merge rather than on the post-merge production deploy (the failure mode behind #291/#292). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 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 00000000..bcbb8b1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +# Build/test guard for pull requests. Runs the same install + build the Pages +# deploy runs, so a broken build, failing tests, type errors, or a +# platform-incomplete package-lock.json fail HERE (before merge) instead of on +# the production deploy after merge. + +on: + pull_request: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + # Strict install — fails fast if package-lock.json is out of sync or is + # missing the linux-x64 native binaries the runner needs (npm/cli#4828). + - name: Install dependencies + run: npm ci + + - name: Type-check + run: npm run type-check + + - name: Test + run: npm test + + - name: Build + run: npm run build