fork of hey-api/openapi-ts because I need some additional things
at feat/skip-token 96 lines 2.6 kB view raw
1name: CI 2 3on: 4 push: 5 branches: 6 - main 7 pull_request: 8 workflow_dispatch: 9 10concurrency: 11 group: ${{ github.workflow }}-${{ github.ref }} 12 cancel-in-progress: true 13 14jobs: 15 setup: 16 name: Setup 17 runs-on: ubuntu-latest 18 outputs: 19 node-version: ${{ steps.nvmrc.outputs.node-version }} 20 steps: 21 - uses: actions/checkout@v6.0.2 22 23 - id: nvmrc 24 run: echo "node-version=$(cat .nvmrc)" >> $GITHUB_OUTPUT 25 26 ci: 27 name: Build, Lint, Test 28 needs: setup 29 runs-on: ${{ matrix.os }} 30 env: 31 TURBO_TEAM: ${{ secrets.TURBO_TEAM }} 32 TURBO_TELEMETRY_DISABLED: 1 33 TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} 34 strategy: 35 matrix: 36 include: 37 # All Node versions on Ubuntu (fast, catches Node issues) 38 - os: ubuntu-latest 39 node-version: '20.19.0' 40 - os: ubuntu-latest 41 node-version: '22.12.0' 42 - os: ubuntu-latest 43 node-version: ${{ needs.setup.outputs.node-version }} 44 is-primary: true # Primary runner for examples/previews 45 # Latest Node on other OSes (catches platform issues) 46 - os: macos-latest 47 node-version: ${{ needs.setup.outputs.node-version }} 48 - os: windows-latest 49 node-version: ${{ needs.setup.outputs.node-version }} 50 steps: 51 - uses: actions/checkout@v6.0.2 52 with: 53 fetch-depth: 0 54 55 - uses: pnpm/action-setup@v4.2.0 56 57 - uses: actions/setup-node@v6 58 with: 59 node-version: ${{ matrix.node-version }} 60 cache: pnpm 61 62 - uses: astral-sh/setup-uv@v7 63 with: 64 enable-cache: true 65 66 - name: Install dependencies 67 run: pnpm install --frozen-lockfile 68 69 - name: Build packages 70 run: pnpm tb "@hey-api/**" 71 72 - name: Check examples generated code 73 if: matrix.is-primary 74 run: pnpm examples:check 75 76 - name: Build examples 77 if: matrix.is-primary 78 run: pnpm tb "@example/**" 79 80 - name: Run linter 81 run: pnpm turbo run lint 82 83 - name: Run type check 84 run: pnpm ty "!@test/openapi-ts" 85 86 - name: Run type check (heavy tests) 87 run: pnpm ty "@test/openapi-ts" 88 89 - name: Run tests 90 run: pnpm test 91 92 - name: Publish preview packages 93 if: matrix.is-primary && github.event_name == 'pull_request' 94 run: ./scripts/publish-preview-packages.sh 95 env: 96 TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}