Version Packages #21602
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: true | |
| 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: true | |
| 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 v16 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 16 | |
| - name: Check for error message on Node.js < v18 | |
| run: node packages/wrangler/src/__tests__/test-old-node-version.js error | |
| - name: Use Node.js v18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Check for error message on Node.js < v20 | |
| run: node packages/wrangler/src/__tests__/test-old-node-version.js error | |
| test: | |
| timeout-minutes: 45 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-test | |
| cancel-in-progress: true | |
| name: ${{ format('Tests ({0})', matrix.description) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| 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@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.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) | |
| # 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.changes.outputs.everything_but_markdown == '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 }} | |
| NODE_DEBUG: "@cloudflare:vite-plugin" | |
| - name: Run tests (vite-plugin playgrounds) | |
| if: steps.changes.outputs.everything_but_markdown == 'true' | |
| run: pnpm run test:ci --log-order=stream --filter="@vite-plugin-cloudflare/playground" | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ | |
| TEST_REPORT_PATH: ${{ runner.temp }}/test-report/vite-plugin-playgrounds/index.html | |
| CI_OS: ${{ matrix.description }} | |
| NODE_DEBUG: "@cloudflare:vite-plugin" | |
| - name: Run tests (fixtures) | |
| if: steps.changes.outputs.everything_but_markdown == 'true' | |
| # Browser rendering is disabled on Ubuntu because of https://pptr.dev/troubleshooting#issues-with-apparmor-on-ubuntu | |
| run: pnpm run test:ci --concurrency 1 --log-order=stream --filter="./fixtures/*" ${{ matrix.os == 'ubuntu-latest' && '--filter="!./fixtures/browser-rendering"' || '' }} | |
| 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 }} | |
| NODE_DEBUG: "@cloudflare:vite-plugin" | |
| - name: Upload turbo logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: turbo-runs-${{ matrix.os }} | |
| path: .turbo/runs |