|
41 | 41 |
|
42 | 42 | - name: DB Check |
43 | 43 | run: bun run --cwd apps/web db:check |
| 44 | + |
| 45 | + # Compiles the Next.js app the same way Vercel does. Typecheck does not catch |
| 46 | + # RSC/"use client" boundary errors, route export shape, or bundler failures; |
| 47 | + # without this job those only surface on the production deploy from `main`. |
| 48 | + build: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + timeout-minutes: 20 |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Checkout |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 57 | + ref: ${{ github.event.pull_request.head.sha }} |
| 58 | + |
| 59 | + - name: Setup Bun |
| 60 | + uses: oven-sh/setup-bun@v2 |
| 61 | + with: |
| 62 | + bun-version: "1.2.14" |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + run: bun install --frozen-lockfile |
| 66 | + |
| 67 | + # Placeholder env so `next build` can compile without a live database. |
| 68 | + # This is a compile/bundle check, not an env-validation check. |
| 69 | + - name: Build (next build) |
| 70 | + run: bun run --cwd apps/web build:ci |
| 71 | + env: |
| 72 | + POSTGRES_URL: postgres://user:pass@localhost:5432/db |
| 73 | + BETTER_AUTH_SECRET: ci_placeholder_secret_at_least_32_chars_long |
| 74 | + ENCRYPTION_KEY: ci_placeholder_secret_at_least_32_chars_long |
| 75 | + JWE_SECRET: ci_placeholder_secret_at_least_32_chars_long |
| 76 | + GITHUB_CLIENT_SECRET: ci-placeholder |
| 77 | + VERCEL_APP_CLIENT_SECRET: ci-placeholder |
| 78 | + NEXT_PUBLIC_GITHUB_CLIENT_ID: ci-placeholder |
| 79 | + NEXT_PUBLIC_VERCEL_APP_CLIENT_ID: ci-placeholder |
| 80 | + NEXT_PUBLIC_AUTH_PROVIDERS: vercel |
| 81 | + NEXT_TELEMETRY_DISABLED: "1" |
| 82 | + |
| 83 | + # PR-only guardrails: enforce the migration rollback rule and surface |
| 84 | + # behavior changes that ship without tests. test-touch warns by default; set |
| 85 | + # STRICT_TEST_TOUCH=1 here to make it blocking once desired. |
| 86 | + guards: |
| 87 | + if: github.event_name == 'pull_request' |
| 88 | + runs-on: ubuntu-latest |
| 89 | + timeout-minutes: 10 |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout |
| 93 | + uses: actions/checkout@v4 |
| 94 | + with: |
| 95 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 96 | + ref: ${{ github.event.pull_request.head.sha }} |
| 97 | + fetch-depth: 0 |
| 98 | + |
| 99 | + - name: Setup Bun |
| 100 | + uses: oven-sh/setup-bun@v2 |
| 101 | + with: |
| 102 | + bun-version: "1.2.14" |
| 103 | + |
| 104 | + - name: Install dependencies |
| 105 | + run: bun install --frozen-lockfile |
| 106 | + |
| 107 | + - name: Fetch base ref |
| 108 | + run: git fetch --no-tags --depth=1 origin "$BASE_REF:refs/remotes/origin/$BASE_REF" |
| 109 | + env: |
| 110 | + BASE_REF: ${{ github.base_ref }} |
| 111 | + |
| 112 | + - name: Migration safety |
| 113 | + run: bun run check:migration-safety |
| 114 | + env: |
| 115 | + BASE_REF: origin/${{ github.base_ref }} |
| 116 | + |
| 117 | + - name: Test-touch guard |
| 118 | + run: bun run check:test-touch |
| 119 | + env: |
| 120 | + BASE_REF: origin/${{ github.base_ref }} |
0 commit comments