chore(deps-dev): bump eslint from 9.39.5 to 10.8.1 #501
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| # A new push supersedes the run in flight for the same ref. main is excluded so | |
| # every commit that lands keeps a complete, attributable run. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| static: | |
| name: Typecheck, lint & format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| # Runs before the linters: if the Node pin has drifted, everything below | |
| # ran on the wrong runtime and the results are not worth reading. | |
| - name: Check Node version pins agree | |
| run: bash scripts/check-node-version.sh | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Lint | |
| run: npm run lint | |
| - name: Format check | |
| run: npm run format:check | |
| build: | |
| name: Next build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| # No env block on purpose: getConfig() validates lazily per request and | |
| # every route is dynamic, so nothing calls it at build time. Verified by | |
| # building with DATABASE_URL and TOKEN_ENCRYPTION_KEY unset. | |
| - name: Build | |
| run: npm run build | |
| docker: | |
| name: Docker image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| # The `Next build` job above builds the full checkout; this one builds | |
| # what Fly actually ships, where .dockerignore has pruned the context. | |
| # Without this gate, a file that reaches into an ignored directory type | |
| # checks clean on every PR and only fails at `flyctl deploy`. No Node | |
| # setup or npm ci: the Dockerfile installs its own dependencies. | |
| - name: Build image | |
| run: docker build . | |
| unit: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: authgd | |
| POSTGRES_PASSWORD: authgd | |
| # docker-compose.dev.yml creates authgd_test via an init script, which | |
| # a service container cannot mount. Naming the database directly is | |
| # equivalent for CI, which never needs the non-test `authgd` database. | |
| POSTGRES_DB: authgd_test | |
| # Host 5433 matches docker-compose.dev.yml, so the TEST_DATABASE_URL | |
| # default baked into tests/helpers/db.ts is correct with no env | |
| # override. This job and `e2e` each get their own service container on | |
| # this port, which is what lets them share the default and still never | |
| # touch the same rows — the reason they were once a single job. | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U authgd -d authgd_test" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| # No migrate step and no Playwright browser: tests/helpers/db.ts migrates | |
| # in its own setupTestDb(), and nothing under tests/ drives a browser. | |
| # The `e2e` job needs both; this one needs neither. | |
| - name: Unit tests | |
| run: npm test | |
| e2e: | |
| name: E2E tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: authgd | |
| POSTGRES_PASSWORD: authgd | |
| POSTGRES_DB: authgd_test | |
| # See the `unit` job: same port, separate container. e2e/env.ts keeps | |
| # this default specifically for CI; locally it derives a per-worktree | |
| # database instead. | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U authgd -d authgd_test" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| # Keyed on the resolved @playwright/test version: the browser build is | |
| # tied to the package version, not to the whole lockfile. | |
| - name: Resolve Playwright version | |
| id: pw | |
| run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT" | |
| - name: Cache Playwright browsers | |
| id: pw-cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ steps.pw.outputs.version }} | |
| # playwright.config.ts declares no `projects`, so only chromium is used. | |
| # On a cache hit the browser is present but its apt dependencies are not, | |
| # since those live outside the cached directory. | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps chromium | |
| # playwright.config.ts serves this build with `next start` under CI | |
| # instead of `next dev`, so route compilation is paid once here rather | |
| # than lazily on the first request to each route — which, under | |
| # `workers: 1`, meant paying it serially in front of the tests. | |
| # | |
| # Built here rather than pulled from the `Next build` job: `needs:` would | |
| # serialize this job behind that one, and `output: "standalone"` makes | |
| # .next an artifact that embeds a traced node_modules. Both cost more | |
| # than the build itself. | |
| # | |
| # No env block, for the same reason that job has none: getConfig() | |
| # validates lazily per request and every route is dynamic. | |
| - name: Build | |
| run: npm run build | |
| # e2e/helpers.ts only TRUNCATEs and assumes the schema exists. Locally | |
| # e2e/provision.ts migrates as part of standing up the per-worktree | |
| # container, but that is gated on `!IS_CI` — so under CI this step is the | |
| # only thing that creates the schema. | |
| - name: Apply migrations to test database | |
| run: npm run db:migrate | |
| env: | |
| DATABASE_URL: postgres://authgd:authgd@localhost:5433/authgd_test | |
| - name: E2E tests | |
| run: npm run test:e2e | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 |