From 5d02bbc3053ebe843eaa1f6ce9fec5c649fcddbc Mon Sep 17 00:00:00 2001 From: FlopBut Date: Sun, 24 May 2026 14:34:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20CI=20quality=20gate=20(lin?= =?UTF-8?q?t=20+=20typecheck=20+=20test)=20on=20node=2022=20/=20yarn=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turn CI from build-only into a real quality gate. New ci.yml runs on push to main and on every PR: yarn install --immutable, yarn lint, yarn typecheck, yarn test — failing the build if any step fails. - Node 22 (LTS) via actions/setup-node@v4 with yarn cache. - Corepack enabled before setup-node so the pinned Yarn 4 resolves and the cache folder is discoverable. - --immutable enforces a single in-sync lockfile (yarn.lock); no npm remains. - Lint fails on errors only; pre-existing warnings stay non-blocking per the eslint config rationale. - README documents the CI gate. Closes FLO-161. Co-Authored-By: Paperclip --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ README.md | 16 +++++++++++++++ 2 files changed, 59 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..7164466 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + +# Cancel superseded runs on the same ref to save CI minutes. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + quality-gate: + name: Lint, typecheck, test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Enable Corepack before setup-node so its yarn cache step can resolve the + # pinned Yarn 4 (from package.json `packageManager`) and find the cache folder. + - name: Enable Corepack + run: corepack enable + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - name: Install dependencies + run: yarn install --immutable + + - name: Lint + run: yarn lint + + - name: Typecheck + run: yarn typecheck + + - name: Test + run: yarn test diff --git a/README.md b/README.md index 39ed655..be8dffd 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,22 @@ yarn lint # run ESLint (flat config) over the repo > The dev and preview servers are served under the `/chaiba/` base path (matching > the GitHub Pages deployment), so open `http://localhost:5173/chaiba/`. +## Continuous integration + +Every push to `main` and every pull request runs the CI quality gate +(`.github/workflows/ci.yml`) on Node 22 (LTS) with Yarn 4 via Corepack. The gate +runs three checks and fails the build if any of them fail: + +```bash +yarn install --immutable # lockfile must be in sync (yarn.lock only) +yarn lint # ESLint — fails on errors (warnings are non-blocking) +yarn typecheck # tsc --noEmit +yarn test # Vitest unit suite +``` + +A PR cannot be merged green unless lint (no errors), typecheck, and the test +suite all pass. Run the same checks locally before pushing to avoid a red CI. + ## Deployment Pushes to `main` are built with Vite and published to GitHub Pages via