chore: Add github actions #6
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
| # =============================================================== | |
| # 🧬 Client Type Generation - verify generated types stay in sync | |
| # =============================================================== | |
| # - regenerates src/generated/ from the committed openapi.json | |
| # - verifies types exist and compile | |
| # --------------------------------------------------------------- | |
| name: Client Type Generation | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| generate-types: | |
| if: github.event_name != 'pull_request' || !github.event.pull_request.draft | |
| name: Generate and verify types | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci --no-audit --no-fund | |
| - name: Generate types with orval | |
| run: npm run generate | |
| - name: Verify generated types exist | |
| run: | | |
| test -d src/generated/types || (echo "ERROR: src/generated/types/ not created" && exit 1) | |
| echo "Generated types count: $(find src/generated/types -name '*.ts' | wc -l)" | |
| - name: Verify generated types compile | |
| run: npx tsc -b --noEmit |