cloudflare/cloudflare-typescript
Publicmirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable
.github/workflows/ci.yml
108lines · modecode
| 1 | name: CI |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - '**' |
| 6 | - '!integrated/**' |
| 7 | - '!stl-preview-head/**' |
| 8 | - '!stl-preview-base/**' |
| 9 | - '!generated' |
| 10 | - '!codegen/**' |
| 11 | - 'codegen/stl/**' |
| 12 | pull_request: |
| 13 | branches-ignore: |
| 14 | - 'stl-preview-head/**' |
| 15 | - 'stl-preview-base/**' |
| 16 | |
| 17 | jobs: |
| 18 | lint: |
| 19 | timeout-minutes: 10 |
| 20 | name: lint |
| 21 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 22 | if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') |
| 23 | steps: |
| 24 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 25 | |
| 26 | - name: Set up Node |
| 27 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 28 | with: |
| 29 | node-version: '22' |
| 30 | |
| 31 | - name: Bootstrap |
| 32 | run: ./scripts/bootstrap |
| 33 | |
| 34 | - name: Check types |
| 35 | run: ./scripts/lint |
| 36 | |
| 37 | build: |
| 38 | timeout-minutes: 5 |
| 39 | name: build |
| 40 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 41 | if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') |
| 42 | permissions: |
| 43 | contents: read |
| 44 | id-token: write |
| 45 | steps: |
| 46 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 47 | |
| 48 | - name: Set up Node |
| 49 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 50 | with: |
| 51 | node-version: '22' |
| 52 | |
| 53 | - name: Bootstrap |
| 54 | run: ./scripts/bootstrap |
| 55 | |
| 56 | - name: Check build |
| 57 | run: ./scripts/build |
| 58 | |
| 59 | - name: Get GitHub OIDC Token |
| 60 | if: |- |
| 61 | github.repository == 'stainless-sdks/cloudflare-typescript' && |
| 62 | !startsWith(github.ref, 'refs/heads/stl/') |
| 63 | id: github-oidc |
| 64 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
| 65 | with: |
| 66 | script: core.setOutput('github_token', await core.getIDToken()); |
| 67 | |
| 68 | - name: Upload tarball |
| 69 | if: |- |
| 70 | github.repository == 'stainless-sdks/cloudflare-typescript' && |
| 71 | !startsWith(github.ref, 'refs/heads/stl/') |
| 72 | env: |
| 73 | URL: https://pkg.stainless.com/s |
| 74 | AUTH: ${{ steps.github-oidc.outputs.github_token }} |
| 75 | SHA: ${{ github.sha }} |
| 76 | run: ./scripts/utils/upload-artifact.sh |
| 77 | |
| 78 | - name: Upload MCP Server tarball |
| 79 | if: |- |
| 80 | github.repository == 'stainless-sdks/cloudflare-typescript' && |
| 81 | !startsWith(github.ref, 'refs/heads/stl/') |
| 82 | env: |
| 83 | URL: https://pkg.stainless.com/s?subpackage=mcp-server |
| 84 | AUTH: ${{ steps.github-oidc.outputs.github_token }} |
| 85 | SHA: ${{ github.sha }} |
| 86 | BASE_PATH: packages/mcp-server |
| 87 | run: ./scripts/utils/upload-artifact.sh |
| 88 | test: |
| 89 | timeout-minutes: 10 |
| 90 | name: test |
| 91 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 92 | if: github.event_name == 'push' || github.event.pull_request.head.repo.fork |
| 93 | steps: |
| 94 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 95 | |
| 96 | - name: Set up Node |
| 97 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 98 | with: |
| 99 | node-version: '22' |
| 100 | |
| 101 | - name: Bootstrap |
| 102 | run: ./scripts/bootstrap |
| 103 | |
| 104 | - name: Build |
| 105 | run: ./scripts/build |
| 106 | |
| 107 | - name: Run tests |
| 108 | run: ./scripts/test |
| 109 | |