name: Vite plugin playgrounds on: merge_group: pull_request: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }} env: # We run `playwright install` manually instead PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" jobs: test: timeout-minutes: 30 name: ${{ format('Vite Plugin Playground ({0}, {1})', matrix.os, matrix.vite) }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] vite: ["vite-8"] include: - os: ubuntu-latest vite: "vite-6" - os: ubuntu-latest vite: "vite-7" runs-on: ${{ matrix.os }} steps: - name: Checkout Repo uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: persist-credentials: false - name: Filter changed paths uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 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: Install playwright if: steps.changes.outputs.everything_but_markdown == 'true' run: | pnpm --filter @vite-plugin-cloudflare/playground playwright:install - name: Build plugin with initial Vite version if: steps.changes.outputs.everything_but_markdown == 'true' run: | pnpm dotenv -- pnpm turbo build --filter @cloudflare/vite-plugin - name: Downgrade to Vite 6 if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.vite == 'vite-6' run: | pnpm update -r --no-save vite@^6.1.0 - name: Downgrade to Vite 7 if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.vite == 'vite-7' run: | pnpm update -r --no-save vite@^7.0.0 - name: Run dev playground tests if: steps.changes.outputs.everything_but_markdown == 'true' # We use `--only` to prevent TurboRepo from rebuilding dependencies # This ensures the Vite plugin is not rebuilt using a different Vite version run: | pnpm dotenv -- pnpm turbo test:ci:serve --filter @vite-plugin-cloudflare/playground --only env: VITE_VERSION: ${{ matrix.vite }} NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html NODE_DEBUG: "@cloudflare:vite-plugin" CI_OS: ${{ matrix.os }} - name: Run build/preview playground tests if: steps.changes.outputs.everything_but_markdown == 'true' # We use `--only` to prevent TurboRepo from rebuilding dependencies # This ensures the Vite plugin is not rebuilt using a different Vite version run: | pnpm dotenv -- pnpm turbo test:ci:build --filter @vite-plugin-cloudflare/playground --only env: VITE_VERSION: ${{ matrix.vite }} NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html NODE_DEBUG: "@cloudflare:vite-plugin" CI_OS: ${{ matrix.os }} - name: Upload turbo logs if: always() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: turbo-runs-${{ matrix.os }}-${{ matrix.vite }} path: .turbo/runs