cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
.github/workflows/ci.yml
113lines · modecode
| 1 | name: CI |
| 2 | on: |
| 3 | push: |
| 4 | branches-ignore: |
| 5 | - 'generated' |
| 6 | - 'codegen/**' |
| 7 | - 'integrated/**' |
| 8 | - 'stl-preview-head/**' |
| 9 | - 'stl-preview-base/**' |
| 10 | pull_request: |
| 11 | branches-ignore: |
| 12 | - 'stl-preview-head/**' |
| 13 | - 'stl-preview-base/**' |
| 14 | |
| 15 | concurrency: |
| 16 | group: ${{ github.workflow }}-${{ github.ref }} |
| 17 | cancel-in-progress: true |
| 18 | |
| 19 | jobs: |
| 20 | lint: |
| 21 | timeout-minutes: 10 |
| 22 | name: lint |
| 23 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 24 | steps: |
| 25 | - uses: actions/checkout@v4 |
| 26 | |
| 27 | - name: Set up Node |
| 28 | uses: actions/setup-node@v4 |
| 29 | with: |
| 30 | node-version: '18' |
| 31 | |
| 32 | - name: Bootstrap |
| 33 | run: ./scripts/bootstrap |
| 34 | |
| 35 | - name: Check types |
| 36 | run: ./scripts/lint |
| 37 | |
| 38 | build: |
| 39 | timeout-minutes: 5 |
| 40 | name: build |
| 41 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 42 | permissions: |
| 43 | contents: read |
| 44 | id-token: write |
| 45 | steps: |
| 46 | - uses: actions/checkout@v4 |
| 47 | |
| 48 | - name: Set up Node |
| 49 | uses: actions/setup-node@v4 |
| 50 | with: |
| 51 | node-version: '18' |
| 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: github.repository == 'stainless-sdks/cloudflare-node' |
| 61 | id: github-oidc |
| 62 | uses: actions/github-script@v6 |
| 63 | with: |
| 64 | script: core.setOutput('github_token', await core.getIDToken()); |
| 65 | |
| 66 | - name: Upload tarball |
| 67 | if: github.repository == 'stainless-sdks/cloudflare-node' |
| 68 | env: |
| 69 | URL: https://pkg.stainless.com/s |
| 70 | AUTH: ${{ steps.github-oidc.outputs.github_token }} |
| 71 | SHA: ${{ github.sha }} |
| 72 | run: ./scripts/utils/upload-artifact.sh |
| 73 | test: |
| 74 | timeout-minutes: 10 |
| 75 | name: test |
| 76 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 77 | steps: |
| 78 | - uses: actions/checkout@v4 |
| 79 | |
| 80 | - name: Set up Node |
| 81 | uses: actions/setup-node@v4 |
| 82 | with: |
| 83 | node-version: '20' |
| 84 | |
| 85 | - name: Bootstrap |
| 86 | run: ./scripts/bootstrap |
| 87 | |
| 88 | - name: Run tests |
| 89 | run: ./scripts/test |
| 90 | examples: |
| 91 | timeout-minutes: 10 |
| 92 | name: examples |
| 93 | runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} |
| 94 | if: github.repository == 'cloudflare/cloudflare-typescript' |
| 95 | |
| 96 | steps: |
| 97 | - uses: actions/checkout@v4 |
| 98 | |
| 99 | - name: Set up Node |
| 100 | uses: actions/setup-node@v4 |
| 101 | with: |
| 102 | node-version: '20' |
| 103 | - name: Install dependencies |
| 104 | run: | |
| 105 | yarn install |
| 106 | |
| 107 | - env: |
| 108 | CLOUDFLARE_ACCOUNT_ID: f037e56e89293a057740de681ac9abbe |
| 109 | CLOUDFLARE_EMAIL: terraform-acceptance-test@cfapi.net |
| 110 | CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c92011 |
| 111 | CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} |
| 112 | run: | |
| 113 | yarn tsn ./examples/ai/demo.ts |
| 114 | |