name: CI on: push: branches: [main] pull_request: branches: [main] env: DATABASE_URL: "postgresql://ci:ci@localhost:5432/batchcooking_ci?schema=public" # Test-only secret, never used outside CI — real deployments must set their own. JWT_SECRET: "ci-only-secret-not-used-anywhere-else-32chars+" jobs: lint-and-test: runs-on: ubuntu-latest services: postgres: image: postgres:16-alpine env: POSTGRES_USER: ci POSTGRES_PASSWORD: ci POSTGRES_DB: batchcooking_ci ports: - 5432:5432 options: >- --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm lint - run: pnpm --filter api exec prisma migrate deploy - run: pnpm --filter api test - run: pnpm --filter api test:bdd - run: pnpm build e2e: runs-on: ubuntu-latest needs: lint-and-test steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: pnpm - name: Cache Cypress binary uses: actions/cache@v4 with: path: ~/.cache/Cypress key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} - run: pnpm install --frozen-lockfile # pnpm install doesn't reliably trigger Cypress's postinstall binary # download (see apps/web's cypress caveat in the README) — install it # explicitly so `cypress run` finds it. - run: pnpm --filter web exec cypress install - run: pnpm --filter web e2e