ci.yml
1,484 bytes
| 1 | name: CI |
|---|---|
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | |
| 8 | jobs: |
| 9 | quality: |
| 10 | name: lint · typecheck · test · build |
| 11 | runs-on: ubuntu-latest |
| 12 | |
| 13 | services: |
| 14 | postgres: |
| 15 | image: postgres:16-alpine |
| 16 | env: |
| 17 | POSTGRES_USER: roundtable |
| 18 | POSTGRES_PASSWORD: roundtable |
| 19 | POSTGRES_DB: roundtable |
| 20 | ports: |
| 21 | - 5432:5432 |
| 22 | options: >- |
| 23 | --health-cmd "pg_isready -U roundtable" |
| 24 | --health-interval 5s |
| 25 | --health-timeout 5s |
| 26 | --health-retries 10 |
| 27 | |
| 28 | env: |
| 29 | DATABASE_URL: postgresql://roundtable:roundtable@localhost:5432/roundtable?schema=public |
| 30 | ENCRYPTION_KEY: '+s0sM+HW2k7YOW3uJxtmVM85xcJ18REhy4tEYF46ALM=' |
| 31 | |
| 32 | steps: |
| 33 | - uses: actions/checkout@v4 |
| 34 | |
| 35 | - uses: pnpm/action-setup@v4 |
| 36 | with: |
| 37 | version: 9.15.0 |
| 38 | |
| 39 | - uses: actions/setup-node@v4 |
| 40 | with: |
| 41 | node-version: 20 |
| 42 | cache: pnpm |
| 43 | |
| 44 | - name: Install dependencies |
| 45 | run: pnpm install --frozen-lockfile |
| 46 | |
| 47 | - name: Generate Prisma client |
| 48 | run: pnpm prisma generate |
| 49 | |
| 50 | - name: Lint |
| 51 | run: pnpm lint |
| 52 | |
| 53 | - name: Typecheck |
| 54 | run: pnpm typecheck |
| 55 | |
| 56 | - name: Unit tests |
| 57 | run: pnpm test |
| 58 | |
| 59 | - name: Build |
| 60 | run: pnpm build |
| 61 | env: |
| 62 | SKIP_ENV_VALIDATION: '1' |
| 63 | NEXT_TELEMETRY_DISABLED: '1' |
| 64 | |
| 65 | - name: Schema + seed smoke test |
| 66 | run: | |
| 67 | pnpm prisma db push --skip-generate |
| 68 | pnpm db:seed |
| 69 | |