name: CI on: push: branches: [main] pull_request: # A superseded run has nothing left to prove; stop it and free the runner. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: quality: name: Lint, typecheck, tests runs-on: ubuntu-latest # The integration tests exercise the device API against a real database. # Mocking Prisma here would only prove the mock works. services: postgres: image: postgres:16-alpine env: POSTGRES_DB: horaires_test POSTGRES_USER: horaires POSTGRES_PASSWORD: horaires ports: - 5432:5432 options: >- --health-cmd "pg_isready -U horaires -d horaires_test" --health-interval 5s --health-timeout 5s --health-retries 20 env: DATABASE_URL: postgresql://horaires:horaires@localhost:5432/horaires_test?schema=public TEST_DATABASE_URL: postgresql://horaires:horaires@localhost:5432/horaires_test?schema=public steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '22' cache: npm - run: npm ci - run: npx prisma generate - run: npx prisma migrate deploy - run: npm run lint - run: npm run typecheck - run: npm run coverage - run: npm run build docker: name: Docker image runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: Build the runtime image uses: docker/build-push-action@v6 with: context: . push: false cache-from: type=gha cache-to: type=gha,mode=max