Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,15 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Install Chromium headless shell
run: bun run playwright install --with-deps --only-shell chromium
# Tests depend on build:artifacts, so Turbo builds the Rust Wasm modules or
# restores them from its cache when crates/ and Cargo inputs are unchanged.
# Install the pinned toolchain first: parallel build:artifacts tasks would
# otherwise race rustup's component downloads on a fresh runner.
- name: Install the pinned Rust toolchain
run: rustup toolchain install --no-self-update
- name: Build release packages
if: ${{ inputs.release_build }}
run: bun run build
- name: Build Rust Wasm artifacts
if: ${{ !inputs.release_build }}
run: bun run build:rust:wasm
- name: Validate packages
shell: bash
env:
Expand Down Expand Up @@ -453,8 +456,12 @@ jobs:
turbo-cache-scope: e2e
- name: Install E2E browsers
run: bun run playwright install --with-deps chromium firefox webkit
- name: Build Rust Wasm artifacts
run: bun run build:rust:wasm
# Tests depend on build:artifacts, so Turbo builds the Rust Wasm modules or
# restores them from its cache when crates/ and Cargo inputs are unchanged.
# Install the pinned toolchain first: parallel build:artifacts tasks would
# otherwise race rustup's component downloads on a fresh runner.
- name: Install the pinned Rust toolchain
run: rustup toolchain install --no-self-update
- name: Run E2E tests
shell: bash
env:
Expand Down Expand Up @@ -504,8 +511,12 @@ jobs:
turbo-cache-scope: compat
- name: Install Chromium headless shell
run: bun run playwright install --only-shell chromium
- name: Build Rust Wasm artifacts
run: bun run build:rust:wasm
# Tests depend on build:artifacts, so Turbo builds the Rust Wasm modules or
# restores them from its cache when crates/ and Cargo inputs are unchanged.
# Install the pinned toolchain first: parallel build:artifacts tasks would
# otherwise race rustup's component downloads on a fresh runner.
- name: Install the pinned Rust toolchain
run: rustup toolchain install --no-self-update
- name: Test packages
shell: bash
env:
Expand Down Expand Up @@ -558,8 +569,12 @@ jobs:
turbo-cache-scope: compat
- name: Install Chromium headless shell
run: bun run playwright install --only-shell chromium
- name: Build Rust Wasm artifacts
run: bun run build:rust:wasm
# Tests depend on build:artifacts, so Turbo builds the Rust Wasm modules or
# restores them from its cache when crates/ and Cargo inputs are unchanged.
# Install the pinned toolchain first: parallel build:artifacts tasks would
# otherwise race rustup's component downloads on a fresh runner.
- name: Install the pinned Rust toolchain
run: rustup toolchain install --no-self-update
- name: Test packages
shell: bash
env:
Expand Down
17 changes: 17 additions & 0 deletions scripts/validation-workflow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,20 @@ test('cache pruning is skipped for pull requests and never fails validation', ()
const failed = prune({ caches: [[1, 'Linux-X64-bun-1.4.4-turbo-build-main-2'], [2, 'Linux-X64-bun-1.4.4-turbo-build-main-1']], listFailure: true })
assert.deepEqual(failed.deleted, [])
})

test('jobs that leave Wasm to Turbo install the pinned toolchain once before any Turbo task', () => {
const turbo = JSON.parse(readFileSync(new URL('../turbo.json', import.meta.url), 'utf8'))
// binding-wasm-* bundle their generated ../artifacts modules, so a build that
// could start before its own build:artifacts fails to resolve them.
assert.ok(turbo.tasks.build.dependsOn.includes('build:artifacts'))
for (const job of ['quality_linux', 'e2e_linux', 'compat_windows', 'compat_macos']) {
const steps = workflow.jobs[job].steps
assert.equal(steps.some(step => step.run === 'bun run build:rust:wasm'), false, job)
// Parallel build:artifacts tasks race rustup's first component download on a
// fresh runner ("could not rename 'downloaded' file"), so one install precedes them.
const install = steps.findIndex(step => step.run === 'rustup toolchain install --no-self-update')
const firstTurbo = steps.findIndex(step => /\bbun run (build|test|e2e|turbo)\b(?!:)|\bturbo run\b/.test(step.run ?? '') && !/--dry/.test(step.run ?? ''))
assert.ok(install >= 0, job)
assert.ok(firstTurbo > install, `${job} runs Turbo before installing the toolchain`)
}
})
Loading