4
0

ci.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Build & Test
  2. on:
  3. pull_request:
  4. branches: [main]
  5. # A second push to the same branch makes the run in flight pointless.
  6. concurrency:
  7. group: ci-${{ github.ref }}
  8. cancel-in-progress: true
  9. jobs:
  10. ci:
  11. name: Lint & Build
  12. runs-on: ubuntu-latest
  13. timeout-minutes: 20
  14. steps:
  15. - uses: actions/checkout@v4
  16. - uses: actions/setup-node@v4
  17. with:
  18. node-version: 22
  19. cache: npm
  20. - run: npm ci
  21. - run: npm run lint
  22. - run: npx prisma generate
  23. - run: npm test
  24. # Next reuses its compiler cache across builds when it is given one.
  25. # This build is the plain one, with no NEXT_PUBLIC_APP_URL override, so
  26. # it keeps its own entry rather than sharing the e2e job's.
  27. - name: Cache the build
  28. uses: actions/cache@v4
  29. with:
  30. path: .next/cache
  31. key: next-ci-${{ hashFiles('package-lock.json') }}-${{ github.sha }}
  32. restore-keys: |
  33. next-ci-${{ hashFiles('package-lock.json') }}-
  34. next-ci-
  35. - run: npm run build