Design/editorial overhaul #99
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # Release gate for the core flows. Runs on every PR and on pushes to the | |
| # main + active design branches. Blocks merges if type-check, lint, the test | |
| # suite (incl. the design-pipeline guard in __tests__/design/pipeline.test.ts), | |
| # or the production build break - so create-design → literature → hypotheses → | |
| # design → chat-context can't silently regress. | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - design/editorial-overhaul | |
| # Cancel superseded runs on the same ref to save CI minutes. | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| name: type-check · lint · test · build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| # `next-env.d.ts` is gitignored (Next.js regenerates it on build), and it | |
| # is what pulls in `next/image-types/global` - the declarations that make | |
| # `import x from "@/public/foo.png"` type-check. Since this job runs | |
| # type-check BEFORE build, the file does not exist yet and every image | |
| # import fails with TS2307. It passes on a developer machine only because | |
| # a previous build left the file behind, which is exactly the kind of | |
| # "works locally" divergence that had main red for weeks. Write the file | |
| # Next would generate, verbatim, before type-checking. | |
| - name: Generate Next.js type references | |
| run: | | |
| cat > next-env.d.ts <<'TYPES' | |
| /// <reference types="next" /> | |
| /// <reference types="next/image-types/global" /> | |
| // NOTE: This file should not be edited | |
| // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. | |
| TYPES | |
| # Deterministic, env-free gates - catch the regressions that have bitten | |
| # the design pipeline (types, wiring, dropped fields, bad merges). | |
| - name: Type check | |
| run: npm run type-check | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test | |
| run: npm test | |
| # Production build - catches issues tsc can't (e.g. edge-runtime bundling). | |
| # Uses placeholder public env so module-load initializers don't fail; the | |
| # build reads real secrets only at request time, not at build. If a future | |
| # build step needs real values, add them as repository secrets here. | |
| - name: Build | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: "https://placeholder.supabase.co" | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY: "placeholder-anon-key" | |
| NEXT_PUBLIC_FIREBASE_API_KEY: "placeholder" | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: "placeholder.firebaseapp.com" | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: "placeholder" | |
| NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: "placeholder.appspot.com" | |
| NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "0000000000" | |
| NEXT_PUBLIC_FIREBASE_APP_ID: "1:0:web:0" |