feat(backend): add HTTP cache headers (ETag + Cache-Control) for GET endpoints — fix #129 #33
Workflow file for this run
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: Backend CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'app/backend/**' | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: | |
| - 'app/backend/**' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile --engine-strict=false | |
| - name: Lint | |
| run: pnpm --filter backend run lint | |
| - name: Test | |
| run: pnpm --filter backend run test | |
| - name: Build | |
| run: pnpm --filter backend run build | |
| - name: Export OpenAPI spec | |
| working-directory: app/backend | |
| env: | |
| DATABASE_URL: file:./prisma/dev.db | |
| NODE_ENV: development | |
| run: npm run spec:export | |
| - name: Check for OpenAPI spec drift | |
| run: | | |
| git diff --exit-code app/frontend/openapi.json || \ | |
| (echo "ERROR: openapi.json is out of date. Run 'npm run spec:export' in app/backend and commit app/frontend/openapi.json." && exit 1) |