The best way to control Claude Code, Codex and more from any computer or phone
| 1 | name: Cloudflare Tools |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | paths: |
| 7 | - "submodules/distilled" |
| 8 | - "packages/cloudflare-runtime/**" |
| 9 | - "packages/cloudflare-test-tools/**" |
| 10 | - "packages/frontend-frameworks/**" |
| 11 | - "packages/node-utils/**" |
| 12 | - "scripts/package-build.ts" |
| 13 | - "scripts/ensure-built.ts" |
| 14 | - "patches/**" |
| 15 | - "package.json" |
| 16 | - "pnpm-lock.yaml" |
| 17 | - "pnpm-workspace.yaml" |
| 18 | - "tsconfig.json" |
| 19 | - ".github/workflows/cloudflare-tools.yml" |
| 20 | pull_request: |
| 21 | types: [opened, reopened, synchronize] |
| 22 | paths: |
| 23 | - "submodules/distilled" |
| 24 | - "packages/cloudflare-runtime/**" |
| 25 | - "packages/cloudflare-test-tools/**" |
| 26 | - "packages/frontend-frameworks/**" |
| 27 | - "packages/node-utils/**" |
| 28 | - "scripts/package-build.ts" |
| 29 | - "scripts/ensure-built.ts" |
| 30 | - "patches/**" |
| 31 | - "package.json" |
| 32 | - "pnpm-lock.yaml" |
| 33 | - "pnpm-workspace.yaml" |
| 34 | - "tsconfig.json" |
| 35 | - ".github/workflows/cloudflare-tools.yml" |
| 36 | workflow_dispatch: |
| 37 | |
| 38 | permissions: |
| 39 | contents: read |
| 40 | |
| 41 | concurrency: |
| 42 | group: cloudflare-tools-${{ github.ref }} |
| 43 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 44 | |
| 45 | jobs: |
| 46 | test: |
| 47 | name: Test (${{ matrix.os }}) |
| 48 | runs-on: ${{ matrix.os }} |
| 49 | strategy: |
| 50 | fail-fast: false |
| 51 | matrix: |
| 52 | os: |
| 53 | - blacksmith-8vcpu-ubuntu-2404 |
| 54 | - blacksmith-6vcpu-macos-latest |
| 55 | - blacksmith-8vcpu-windows-2025 |
| 56 | steps: |
| 57 | - name: Checkout repository |
| 58 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 59 | |
| 60 | - name: Checkout distilled |
| 61 | run: git submodule update --init --depth=1 --checkout -- submodules/distilled |
| 62 | |
| 63 | - name: Setup pnpm, Node.js, Bun and install dependencies |
| 64 | uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0 |
| 65 | with: |
| 66 | cache: true |
| 67 | install: true |
| 68 | require-lockfile: true |
| 69 | |
| 70 | # The Browser Rendering suite launches the pinned Chrome build |
| 71 | # (BROWSER_VERSION), which it otherwise downloads (~145 MB) at test time |
| 72 | # into wrangler's cache. A stalled download times out every session test. |
| 73 | - name: Cache Chrome for the Browser Rendering binding |
| 74 | uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 75 | with: |
| 76 | path: | |
| 77 | ~/.cache/.wrangler/chrome |
| 78 | ~/Library/Caches/.wrangler/chrome |
| 79 | ~/AppData/Local/xdg.cache/.wrangler/chrome |
| 80 | key: browser-rendering-chrome-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('packages/cloudflare-runtime/src/core/bindings/browser/BrowserOptions.shared.ts') }} |
| 81 | |
| 82 | # Type checking is OS-independent and runs once in check.yml |
| 83 | # (`pnpm typecheck`). Test builds what it needs via ensure:built. |
| 84 | - name: Test |
| 85 | run: pnpm test:cloudflare-packages |
| 86 | env: |
| 87 | # Limit concurrent package test runs on the smaller runners. |
| 88 | pnpm_config_workspace_concurrency: ${{ runner.os == 'Windows' && '3' || runner.os == 'macOS' && '2' || '' }} |
| 89 | # No Docker daemon for Linux images on these runners; the Linux job |
| 90 | # runs the container suites (see packages/cloudflare-runtime/vitest.config.ts). |
| 91 | ALCHEMY_TEST_EXCLUDE_LINUX_CONTAINERS: ${{ runner.os != 'Linux' && '1' || '' }} |