From 8192de136aecf49cb0ac1e5b223b841c2be83b1e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 24 Jul 2026 12:37:17 +0200 Subject: [PATCH] Gate Playwright CI setup on bucket content Six Playwright setup steps in test-smokes.yml (node install, browser cache/install, system deps) ran on every Linux job regardless of whether the job's test bucket contained a Playwright test. Under test-smokes-parallel (~20 bucket jobs per push/PR to main) that meant ~19 jobs paid 2-3 min of unused browser/system-deps installation and carried its failure surface: run 30081294158 died in `npx playwright install-deps` on a transient apt failure a bucket without Playwright had no reason to touch. Gate the six steps the way the rsvg-convert step already gates on bucket content: run only for a full serial run (empty buckets) or a bucket containing integration/playwright-tests.test.ts. Drop the schedule escape, since the suite is ignored on Windows CI (ignore: gha.isGitHubActions() && isWindows) and browser setup was pure waste there in every mode. --- .github/workflows/test-smokes.yml | 35 +++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-smokes.yml b/.github/workflows/test-smokes.yml index 652807eddd..bc398ef00c 100644 --- a/.github/workflows/test-smokes.yml +++ b/.github/workflows/test-smokes.yml @@ -85,8 +85,16 @@ jobs: with: node-version: 22 + # Playwright setup is only needed when this job can actually run the + # playwright suite: a bucket containing playwright-tests.test.ts, or a + # full run (empty buckets, which includes integration/). Windows never + # needs it: the suite is ignored on Windows CI (playwright-tests.test.ts, + # `ignore: gha.isGitHubActions() && isWindows`). - name: Cache multiplex server node_modules - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) uses: actions/cache@v5 with: path: tests/integration/playwright/multiplex-server/node_modules @@ -95,13 +103,19 @@ jobs: ${{ runner.os }}-multiplex-server- - name: Install node dependencies - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) run: npm install --loglevel=error --no-audit working-directory: ./tests/integration/playwright shell: bash - name: Get Playwright version - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) run: | VERSION=$(node -p "require('@playwright/test/package.json').version") echo "PLAYWRIGHT_VERSION=$VERSION" >> "$GITHUB_ENV" @@ -109,7 +123,10 @@ jobs: shell: bash - name: Cache Playwright browsers - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) uses: actions/cache@v5 with: path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} @@ -118,13 +135,19 @@ jobs: ${{ runner.os }}-playwright- - name: Install Playwright system dependencies - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) timeout-minutes: 15 run: npx playwright install-deps working-directory: ./tests/integration/playwright - name: Install Playwright Browsers - if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }} + if: >- + runner.os != 'Windows' + && (format('{0}', inputs.buckets) == '' + || contains(inputs.buckets, 'playwright-tests.test.ts')) timeout-minutes: 15 run: npx playwright install working-directory: ./tests/integration/playwright