45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
env:
|
|
DATABASE_URL: file:./ci.db
|
|
NEXT_PUBLIC_APP_URL: http://localhost:3000
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Validate Prisma schema
|
|
run: pnpm prisma validate
|
|
- name: Generate Prisma client
|
|
run: pnpm prisma generate
|
|
- name: Apply migrations to disposable database
|
|
run: pnpm prisma migrate deploy
|
|
- name: Check migration drift
|
|
run: pnpm prisma migrate diff --from-migrations prisma/migrations --to-schema-datamodel prisma/schema.prisma --exit-code
|
|
- name: Lint
|
|
run: pnpm lint
|
|
- name: Unit tests
|
|
run: pnpm test
|
|
- name: Typecheck and production build
|
|
run: pnpm typecheck
|
|
- name: Audit production dependencies
|
|
run: pnpm audit --prod --audit-level=high
|