ci: regenerate from the committed spec so the drift check is hermetic #33
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] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install --frozen-lockfile | |
| # Hermetic: regenerates from the committed spec, so this verifies that the committed | |
| # generated code still reproduces from it, with no network dependency. Refreshing the | |
| # spec itself is the release workflow's job. | |
| - name: Codegen drift check | |
| env: | |
| ROXYAPI_SPEC_FILE: specs/openapi.json | |
| run: | | |
| bun run generate | |
| git diff --exit-code -- specs/openapi.json src/client.gen.ts src/sdk.gen.ts src/types.gen.ts src/client src/core \ | |
| || { echo 'codegen drift: commit the regenerated files'; exit 1; } | |
| - name: Lint | |
| run: bunx biome ci . | |
| - name: Typecheck | |
| run: bun typecheck | |
| - name: Docs drift check | |
| run: | | |
| bun run docs:sync | |
| git diff --exit-code -- README.md AGENTS.md docs/llms-full.txt \ | |
| || { echo 'docs drift: commit the regenerated README.md/AGENTS.md/llms-full.txt'; exit 1; } | |
| - name: Test | |
| run: bun run test |