70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
312 lines
15 KiB
YAML
312 lines
15 KiB
YAML
name: C3 E2E
|
|
on:
|
|
merge_group:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
# pnpm 11-specific settings - recognised by pnpm 11+ and
|
|
# silently ignored by pnpm 10.
|
|
#
|
|
# - pmOnFail=ignore: pnpm 11's default `download` would silently re-exec as
|
|
# the monorepo's pinned pnpm 10.33.0, defeating the matrix override.
|
|
# - verifyDepsBeforeRun=false: pnpm 11's default `install` would re-run
|
|
# `pnpm install` at the monorepo root before invoking the script, which
|
|
# then trips on engines.pnpm.
|
|
env:
|
|
pnpm_config_pm_on_fail: ignore
|
|
pnpm_config_verify_deps_before_run: "false"
|
|
|
|
jobs:
|
|
e2e:
|
|
# Runs the non-frameworks C3 E2E tests on all supported operating systems
|
|
# and package managers.
|
|
timeout-minutes: 45
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os.name }}-${{ matrix.pm.name }}-${{ matrix.pm.version }}${{ matrix.experimental && '-experimental' || '' }}-${{ matrix.filter }}
|
|
cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }}
|
|
# `matrix.pm.label` is the display name in job/artifact names. Default
|
|
# pm entries use the plain name (e.g. `pnpm`) to keep historical required-
|
|
# check names stable; non-default entries (e.g. pnpm 11) suffix the version.
|
|
name: ${{ format('C3 E2E ({0}, {1}{2}) - {3}', matrix.pm.label, matrix.os.description, matrix.experimental && ', experimental' || '', matrix.filter) }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
experimental: [false]
|
|
filter: ["cli", "workers"]
|
|
os: [{ name: ubuntu-latest, description: Linux }]
|
|
pm:
|
|
- { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
- { name: pnpm, version: "11.5.1", label: "pnpm@11.5.1" }
|
|
- { name: npm, version: "0.0.0", label: "npm" }
|
|
# The yarn tests keep failing on Linux with out of space errors, with no clear reason why. Disabling for now.
|
|
# - { name: yarn, version: "1.0.0", label: "yarn" }
|
|
include:
|
|
# Windows and experimental entries stay on the default pnpm to
|
|
# preserve historical required-check names. pnpm 11 coverage comes
|
|
# from the Linux base entries above.
|
|
- os: { name: windows-latest, description: Windows }
|
|
pm: { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
filter: "cli"
|
|
- os: { name: windows-latest, description: Windows }
|
|
pm: { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
filter: "workers"
|
|
- os: { name: ubuntu-latest, description: Linux }
|
|
pm: { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
experimental: true
|
|
filter: "cli"
|
|
- os: { name: ubuntu-latest, description: Linux }
|
|
pm: { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
experimental: true
|
|
filter: "workers"
|
|
runs-on: ${{ matrix.os.name }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- 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 Python uv
|
|
if: steps.changes.outputs.everything_but_markdown == 'true'
|
|
uses: ./.github/actions/install-python-uv
|
|
|
|
# Needed because gatsby requires git
|
|
- name: Configure Git
|
|
shell: bash
|
|
run: |
|
|
git config --global user.email wrangler@cloudflare.com
|
|
git config --global user.name 'Wrangler Tester'
|
|
|
|
# Put the matrix pnpm version on PATH so scaffolded-project installs
|
|
# run it (not the monorepo's pinned pnpm 10.33.0). Without this, the
|
|
# matrix only relabels C3's `npm_config_user_agent` and pnpm 11
|
|
# regressions go undetected.
|
|
#
|
|
# `pnpm/action-setup` refuses when both `version` input and the root
|
|
# `package.json#packageManager` are set, so we point it at a stub
|
|
# `package.json`. We also loosen `engines.pnpm` to avoid pnpm 11
|
|
# bailing with ERR_PNPM_UNSUPPORTED_ENGINE at the monorepo root.
|
|
- name: Prepare workspace for matrix pnpm install
|
|
if: matrix.pm.name == 'pnpm' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: |
|
|
mkdir -p .ci-pnpm-setup-stub
|
|
printf '{"name":"ci-stub","private":true}\n' > .ci-pnpm-setup-stub/package.json
|
|
node -e "
|
|
const fs = require('node:fs');
|
|
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
|
|
if (pkg.engines && pkg.engines.pnpm) pkg.engines.pnpm = '*';
|
|
fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
|
|
"
|
|
- name: Install matrix pnpm version for scaffolded installs
|
|
if: matrix.pm.name == 'pnpm' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
|
with:
|
|
version: ${{ matrix.pm.version }}
|
|
package_json_file: .ci-pnpm-setup-stub/package.json
|
|
# Distinct dest so `addPath` prepends ahead of the monorepo's
|
|
# pinned pnpm 10.x from the earlier `~/setup-pnpm`.
|
|
dest: ~/matrix-pnpm
|
|
- name: Verify pnpm on PATH matches matrix version
|
|
if: matrix.pm.name == 'pnpm' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: |
|
|
got="$(pnpm --version)"
|
|
want="${{ matrix.pm.version }}"
|
|
echo "pnpm on PATH: $got (expected $want)"
|
|
[ "$got" = "$want" ] || { echo "ERROR: PATH pnpm is $got, not $want — scaffolded installs would silently run the wrong version."; exit 1; }
|
|
|
|
- id: run-e2e
|
|
if: steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: pnpm run test:e2e:c3
|
|
env:
|
|
NODE_VERSION: ${{ env.NODE_VERSION }}
|
|
E2E_EXPERIMENTAL: ${{ matrix.experimental }}
|
|
E2E_TEST_PM: ${{ matrix.pm.name }}
|
|
E2E_TEST_PM_VERSION: ${{ matrix.pm.version }}
|
|
E2E_TEST_FILTER: ${{ matrix.filter }}
|
|
CI_OS: ${{ runner.os }}
|
|
GITHUB_TOKEN: ${{ github.token }} # Needed for begit to clone the repo in the e2e tests for solid-start
|
|
|
|
- name: Upload Logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.changes.outputs.everything_but_markdown == 'true' }}
|
|
with:
|
|
name: ${{ format('e2e-logs-{0}-{1}-{2}-{3}', matrix.pm.label, matrix.os.description, matrix.experimental && 'experimental' || 'normal', matrix.filter) }}
|
|
path: packages/create-cloudflare/.e2e-logs${{matrix.experimental == 'true' && '-experimental' || ''}}/${{ matrix.pm.name }}/${{ matrix.filter }}
|
|
include-hidden-files: true
|
|
|
|
- name: Upload Turbo Summary
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.changes.outputs.everything_but_markdown == 'true' }}
|
|
with:
|
|
name: ${{ format('turbo-runs-{0}-{1}-{2}-{3}', matrix.pm.label, matrix.os.description, matrix.experimental && 'experimental' || 'normal', matrix.filter) }}
|
|
path: .turbo/runs
|
|
include-hidden-files: true
|
|
|
|
frameworks-e2e:
|
|
# Runs the C3 frameworks E2E tests only in the merge queue, on the release branch, if create-cloudflare has changed, or when explicitly requested via label.
|
|
#
|
|
# Frameworks that delegate install to their own generator (e.g. `hono`)
|
|
# don't route through C3's `ERR_PNPM_IGNORED_BUILDS` recovery path; those
|
|
# tests opt out of pnpm 11 via `unsupportedPmRanges` in the test config.
|
|
timeout-minutes: 45
|
|
concurrency:
|
|
group: ${{ github.workflow }}-frameworks${{ matrix.experimental && '-experimental' || '' }}-${{ github.ref }}-${{ matrix.os.name }}-${{ matrix.pm.name }}-${{ matrix.pm.version }}
|
|
cancel-in-progress: ${{ github.head_ref != 'changeset-release/main' }}
|
|
name: ${{ format('C3 E2E ({0}, {1}{2}) - frameworks', matrix.pm.label, matrix.os.description, matrix.experimental && ', experimental' || '') }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
experimental: [false]
|
|
os:
|
|
- { name: ubuntu-latest, description: Linux }
|
|
pm:
|
|
- { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
- { name: pnpm, version: "11.5.1", label: "pnpm@11.5.1" }
|
|
- { name: npm, version: "0.0.0", label: "npm" }
|
|
include:
|
|
# Experimental stays on the default pnpm to preserve historical
|
|
# required-check names; pnpm 11 coverage comes from the base entry.
|
|
- os: { name: ubuntu-latest, description: Linux }
|
|
pm: { name: pnpm, version: "10.33.0", label: "pnpm" }
|
|
experimental: true
|
|
runs-on: ${{ matrix.os.name }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
|
|
id: changes
|
|
with:
|
|
filters: |
|
|
everything_but_markdown:
|
|
- '!**/*.md'
|
|
framework_deps:
|
|
- 'packages/create-cloudflare/**'
|
|
|
|
- name: Check if frameworks tests should run
|
|
id: check-frameworks
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
HEAD_REF: ${{ github.head_ref }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
REPO: ${{ github.repository }}
|
|
FRAMEWORK_DEPS_CHANGED: ${{ steps.changes.outputs.framework_deps }}
|
|
run: |
|
|
if [ "$EVENT_NAME" = "merge_group" ] || \
|
|
[ "$HEAD_REF" = "changeset-release/main" ] || \
|
|
[ "$FRAMEWORK_DEPS_CHANGED" = "true" ]; then
|
|
echo "run_frameworks=true" >> "$GITHUB_OUTPUT"
|
|
elif [ "$EVENT_NAME" = "pull_request" ]; then
|
|
HAS_LABEL=$(gh pr view "$PR_NUMBER" \
|
|
--repo "$REPO" --json labels \
|
|
--jq '[.labels[].name] | any(. == "run-c3-frameworks-tests")')
|
|
echo "run_frameworks=${HAS_LABEL}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "run_frameworks=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Install Dependencies
|
|
if: steps.check-frameworks.outputs.run_frameworks == 'true' && 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 Python uv
|
|
if: steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
uses: ./.github/actions/install-python-uv
|
|
|
|
- name: Configure Git
|
|
if: steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: |
|
|
git config --global user.email wrangler@cloudflare.com
|
|
git config --global user.name 'Wrangler Tester'
|
|
|
|
# See the equivalent step in the `e2e` job above for context.
|
|
- name: Prepare workspace for matrix pnpm install
|
|
if: matrix.pm.name == 'pnpm' && steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: |
|
|
mkdir -p .ci-pnpm-setup-stub
|
|
printf '{"name":"ci-stub","private":true}\n' > .ci-pnpm-setup-stub/package.json
|
|
node -e "
|
|
const fs = require('node:fs');
|
|
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
|
|
if (pkg.engines && pkg.engines.pnpm) pkg.engines.pnpm = '*';
|
|
fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
|
|
"
|
|
- name: Install matrix pnpm version for scaffolded installs
|
|
if: matrix.pm.name == 'pnpm' && steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
|
with:
|
|
version: ${{ matrix.pm.version }}
|
|
package_json_file: .ci-pnpm-setup-stub/package.json
|
|
dest: ~/matrix-pnpm
|
|
- name: Verify pnpm on PATH matches matrix version
|
|
if: matrix.pm.name == 'pnpm' && steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: |
|
|
got="$(pnpm --version)"
|
|
want="${{ matrix.pm.version }}"
|
|
echo "pnpm on PATH: $got (expected $want)"
|
|
[ "$got" = "$want" ] || { echo "ERROR: PATH pnpm is $got, not $want — scaffolded installs would silently run the wrong version."; exit 1; }
|
|
|
|
- id: run-e2e
|
|
if: steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true'
|
|
shell: bash
|
|
run: pnpm run test:e2e:c3
|
|
env:
|
|
NODE_VERSION: ${{ env.NODE_VERSION }}
|
|
E2E_EXPERIMENTAL: ${{ matrix.experimental }}
|
|
E2E_TEST_PM: ${{ matrix.pm.name }}
|
|
E2E_TEST_PM_VERSION: ${{ matrix.pm.version }}
|
|
E2E_TEST_FILTER: frameworks
|
|
CI_OS: ${{ runner.os }}
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
- name: Upload Logs
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true' }}
|
|
with:
|
|
name: ${{ format('e2e-logs-{0}-{1}-{2}-frameworks', matrix.pm.label, matrix.os.description, matrix.experimental && 'experimental' || 'normal') }}
|
|
path: packages/create-cloudflare/.e2e-logs${{matrix.experimental == 'true' && '-experimental' || ''}}/${{ matrix.pm.name }}/frameworks
|
|
include-hidden-files: true
|
|
|
|
- name: Upload Turbo Summary
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: ${{ !cancelled() && steps.check-frameworks.outputs.run_frameworks == 'true' && steps.changes.outputs.everything_but_markdown == 'true' }}
|
|
with:
|
|
name: ${{ format('turbo-runs-{0}-{1}-{2}-frameworks', matrix.pm.label, matrix.os.description, matrix.experimental && 'experimental' || 'normal') }}
|
|
path: .turbo/runs
|
|
include-hidden-files: true
|