name: CI

on:
  push:
  pull_request:

jobs:
  quality:
    runs-on: ubuntu-latest
    env:
      DATABASE_URL: postgresql://postgres:postgres@localhost:5432/moh_sass?schema=public
      NEXT_TELEMETRY_DISABLED: "1"
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm

      - name: Install dependencies
        run: npm ci

      - name: Generate Prisma client
        run: npm run prisma:generate

      - name: Lint
        run: npm run lint

      - name: Test
        # Integration tests use an in-process PGlite database, so no service
        # container is needed — the suite runs standalone.
        run: npm test

      - name: Build
        run: npm run build
