Previously the workflow only ran on `pull_request: branches: [main]`, so any direct push to `main` (or any other branch) bypassed CI entirely. Changes: - Add `push: branches: [main]` to the trigger list so main-branch pushes also run typecheck / test / build / audit. - Add a new `audit` job that runs `pnpm audit --audit-level high` and surfaces high/critical advisories in the CI output. The audit job is intentionally non-blocking (`continue-on-error: true`) on first introduction: the lockfile currently has 2 high + 1 critical transitive advisories (sentry-webpack-plugin → webpack → schema-utils → ajv → fast-uri chain) that need to be addressed before audit can become a hard gate. A comment in the workflow notes that the flag should be flipped to `false` once those are resolved. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
# Non-blocking dependency audit. Surfaces high / critical vulnerabilities
|
|
# in the CI output without failing the build. Flip `continue-on-error` to
|
|
# `false` once the current transitive vulns (see #97) are resolved.
|
|
audit:
|
|
name: Dependency Audit
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm audit --audit-level high
|
|
|
|
typecheck:
|
|
name: Type Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm exec tsc --noEmit
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm lint
|
|
|
|
test:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm test
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: [typecheck, test]
|
|
env:
|
|
DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
|
|
AUTH_SECRET: ci-placeholder-secret-not-used-in-tests
|
|
NEXT_PUBLIC_WWV_EDITION: local
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm build
|