api: trustProxy so rate limiting actually keys on the real client IP #64
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: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.14.2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| # Prisma client is needed for the API's typecheck (imports | |
| # @prisma/client types). Run from repo root so Prisma finds | |
| # prisma/schema.prisma at its default relative path; --filter | |
| # would CD into apps/api/ where the schema doesn't exist. | |
| - run: pnpm exec prisma generate | |
| - name: Typecheck API | |
| run: pnpm --filter @learncode/api build | |
| - name: Build web | |
| run: pnpm --filter @learncode/web build | |
| # Only the self-contained unit tests. The known-good-solutions | |
| # integration test needs a seeded DB and is skipped in CI. | |
| - name: Unit tests (API) | |
| run: pnpm --filter @learncode/api exec vitest run src/lib/testRunner.test.ts |