[pull] main from cloudflare:main #2773
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
| name: CI | |
| on: | |
| merge_group: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| add-to-project: | |
| if: github.head_ref != 'changeset-release/main' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-add-pr | |
| cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }} | |
| timeout-minutes: 30 | |
| name: Add PR to project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: curl -X POST https://devprod-status-bot.devprod.workers.dev/pr-project/workers-sdk/${{ github.event.number }} | |
| check: | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-checks | |
| cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }} | |
| name: "Checks" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Dependencies | |
| uses: ./.github/actions/install-dependencies | |
| with: | |
| turbo-api: ${{ secrets.TURBO_API }} | |
| turbo-team: ${{ secrets.TURBO_TEAM }} | |
| turbo-token: ${{ secrets.TURBO_TOKEN }} | |
| turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} | |
| - name: Check the changesets | |
| run: node -r esbuild-register tools/deployments/validate-changesets.ts | |
| - name: Bump package versions | |
| run: node .github/changeset-version.js | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Check for errors | |
| run: pnpm run check --summarize | |
| env: | |
| CI_OS: ${{ runner.os }} | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| # Check for old Node.js version warnings and errors | |
| - name: Use Node.js v20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Check for error message on Node.js < v22 | |
| run: node packages/wrangler/src/__tests__/test-old-node-version.js error | |
| test: | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.suite }}-test | |
| cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }} | |
| name: ${{ format('Tests ({0}, {1})', matrix.description, matrix.suite) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| suite: | |
| - packages-and-tools | |
| - fixtures | |
| include: | |
| - os: macos-latest | |
| description: macOS | |
| - os: ubuntu-latest | |
| description: Linux | |
| - os: windows-latest | |
| description: Windows | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Filter changed paths | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
| id: changes | |
| with: | |
| filters: | | |
| everything_but_markdown: | |
| - '!**/*.md' | |
| - name: Install Dependencies | |
| if: steps.changes.outputs.everything_but_markdown == 'true' | |
| uses: ./.github/actions/install-dependencies | |
| with: | |
| turbo-api: ${{ secrets.TURBO_API }} | |
| turbo-team: ${{ secrets.TURBO_TEAM }} | |
| turbo-token: ${{ secrets.TURBO_TOKEN }} | |
| turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} | |
| - name: Bump package versions | |
| if: steps.changes.outputs.everything_but_markdown == 'true' | |
| run: node .github/changeset-version.js | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Run tests (tools only) | |
| # tools _only_ needs to be tested on Linux because they're only intended to run in CI | |
| if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.suite == 'packages-and-tools' && matrix.os == 'ubuntu-latest' | |
| run: pnpm run test:ci --log-order=stream --filter="@cloudflare/tools" | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| TEST_REPORT_PATH: ${{ runner.temp }}/test-report/tools/index.html | |
| CI_OS: ${{ matrix.description }} | |
| - name: Run tests (packages) | |
| if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.suite == 'packages-and-tools' | |
| # We skip @cloudflare/vitest-pool-workers tests in CI on Windows because they're very flaky. We still run the vitest-pool-workers-examples fixture, which is a comprehensive set of example tests and gives us a lot of confidence. | |
| # The @cloudflare/vitest-pool-workers tests skipped are things like watch mode, which constantly times out probably due to the github runners in use. | |
| # Package tests are well-isolated (separate processes, temp dirs, random ports, MSW mocks) and can safely run in parallel. | |
| # Concurrency is capped at 3 to avoid CPU starvation on 4-vCPU CI runners when heavyweight suites | |
| # (wrangler/forks, miniflare/workerd, vitest-pool-workers/Verdaccio) overlap. | |
| run: pnpm run test:ci --log-order=stream --concurrency=3 --filter="./packages/*" ${{ matrix.os == 'windows-latest' && '--filter="!./packages/vitest-pool-workers"' || '' }} | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ | |
| TEST_REPORT_PATH: ${{ runner.temp }}/test-report/packages/index.html | |
| CI_OS: ${{ matrix.description }} | |
| - name: Run tests (fixtures) | |
| if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.suite == 'fixtures' | |
| # Browser Run fixture is disabled on Ubuntu because of https://pptr.dev/troubleshooting#issues-with-apparmor-on-ubuntu | |
| # Since the dev registry is now file-based (not network-based), fixture tests can safely run in parallel. | |
| # Concurrency is capped at 2 to avoid CPU starvation on CI runners when multiple fixtures | |
| # spawn workerd processes simultaneously (Windows runners are especially slow under load). | |
| run: pnpm run test:ci --concurrency=2 --log-order=stream --filter="./fixtures/*" ${{ matrix.os == 'ubuntu-latest' && '--filter="!./fixtures/browser-run"' || '' }} | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ | |
| TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html | |
| CI_OS: ${{ matrix.description }} | |
| - name: Upload turbo logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: turbo-runs-${{ matrix.os }}-${{ matrix.suite }} | |
| path: .turbo/runs |