Fix production resilience: middleware 504s + guest mode when Supabase down #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| - run: npm ci | |
| - name: Secret scan (tracked files) | |
| run: npm run secret-scan | |
| - run: npm run typecheck | |
| - run: npm run lint | |
| - name: Unit tests | |
| run: npm run test:unit | |
| - run: npm run build | |
| env: | |
| # Build succeeds without real keys; routes are lazy at runtime. | |
| MINIMAX_API_KEY: ci-placeholder | |
| MINIMAX_MODEL: MiniMax-M3 | |
| - name: Engine E2E (offline, no server) | |
| run: npm run test:engines | |
| - name: Start server and smoke test | |
| env: | |
| MINIMAX_API_KEY: ci-placeholder | |
| MINIMAX_MODEL: MiniMax-M3 | |
| run: | | |
| npm start & | |
| for i in $(seq 1 30); do | |
| curl -sf http://localhost:3000/api/status && break | |
| sleep 2 | |
| done | |
| BASE_URL=http://localhost:3000 npm run test:smoke | |
| BASE_URL=http://localhost:3000 npm run test:auth | |
| - name: Dependency audit (high+ only) | |
| run: npm audit --audit-level=high | |
| continue-on-error: true |