name: CI (Other Node Versions) description: Run primary tests on other supported Node.js versions on: merge_group: pull_request: types: [synchronize, opened, reopened, labeled, unlabeled] permissions: contents: read jobs: test-other-node-versions: timeout-minutes: 45 runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.node_version }}-test-other-node-versions cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }} name: ${{ format('Tests ({0})', matrix.description) }} strategy: fail-fast: false matrix: # expected_to_fail: if true, tests may fail on this Node version. # These versions are skipped on normal PRs but run on Version Packages PRs # (changeset-release/main) or when the 'ci:test-all-node-versions' label is added. # # Node 24 is pinned to 24.18.0 (rather than floating `24`): Node 24.17.0 # regressed node-fetch@2 keep-alive responses with ERR_STREAM_PREMATURE_CLOSE # (nodejs/node#63989, fixed in 24.18.0). `description` stays "Node 24" to # keep the job/check name stable. include: - { node_version: 24.18.0, description: "Node 24", expected_to_fail: true, } - { node_version: 25, description: "Node 25", expected_to_fail: true } steps: - name: Checkout Repo uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 1 persist-credentials: false - name: Filter changed paths uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: changes with: filters: | everything_but_markdown: - '!**/*.md' - name: Check if should run tests id: should_run env: CHANGES_EVERYTHING_BUT_MARKDOWN: ${{ steps.changes.outputs.everything_but_markdown }} EXPECTED_TO_FAIL: ${{ matrix.expected_to_fail }} HAS_TEST_ALL_NODE_VERSIONS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'ci:test-all-node-versions') }} HEAD_REF: ${{ github.event.pull_request.head.ref }} run: | if [[ "$CHANGES_EVERYTHING_BUT_MARKDOWN" == "true" ]] && \ [[ "$EXPECTED_TO_FAIL" != "true" || \ "$HEAD_REF" == "changeset-release/main" || \ "$HAS_TEST_ALL_NODE_VERSIONS_LABEL" == "true" ]]; then echo "result=true" >> $GITHUB_OUTPUT else echo "result=false" >> $GITHUB_OUTPUT fi - name: Install Dependencies if: steps.should_run.outputs.result == 'true' uses: ./.github/actions/install-dependencies with: node-version: ${{ matrix.node_version }} turbo-api: ${{ secrets.TURBO_API }} turbo-team: ${{ secrets.TURBO_TEAM }} turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} # The miniflare browser-rendering tests download Chrome (~150 MB) via # @puppeteer/browsers at runtime. Caching the binary avoids repeat # downloads and reduces the chance of tests hanging while waiting for # the download to finish within their timeout window. - name: Restore Chrome browser cache (Browser Run) if: steps.should_run.outputs.result == 'true' uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: key: chrome-${{ runner.os }}-${{ hashFiles('packages/miniflare/src/plugins/browser-rendering/browser-version.ts') }} path: | ~/.cache/.wrangler/chrome - name: Run tests (packages) # We are running the package tests first be able to get early feedback on changes. # There is no point in running the fixtures if a package is broken. if: steps.should_run.outputs.result == 'true' run: pnpm run test:ci --log-order=stream --concurrency=1 --filter="./packages/*" 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 e2e tests (unenv-preset) if: steps.should_run.outputs.result == 'true' run: pnpm test:e2e --filter wrangler -- unenv-preset env: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ CI_OS: ${{ matrix.description }} - name: Run tests (vite-plugin) if: steps.should_run.outputs.result == 'true' run: pnpm test:ci --filter @cloudflare/vite-plugin env: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ CI_OS: ${{ matrix.description }}