[pull] main from cloudflare:main #771
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 (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. | |
| include: | |
| - { node_version: 24, 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@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
| 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@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| 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 }} |