From 9c65463b4cf26882ed37f39f286618886e159c0e Mon Sep 17 00:00:00 2001 From: Zachary Miller Date: Tue, 10 Nov 2026 09:55:28 -0500 Subject: [PATCH] Run each browser test project in its own job The Chromium job ran two projects, pace.js and pace.min.js, one after the other, so it took about twice as long as the Firefox and WebKit jobs, and the whole run waited for it. Each project now runs in its own job, in parallel, still one test at a time within a job. The final browser-tests job, the required check, now passes only if every project passed. --- .github/workflows/checks.yml | 27 ++++++++++++++++----------- playwright.config.mjs | 4 ++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7e702ac..74a053b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,15 +31,20 @@ jobs: - name: List package contents run: npm pack --dry-run - # One job per engine, in parallel. - browser-engines: - name: browser-tests (${{ matrix.browser }}) + # One job per Playwright project (an engine and a pace file), in parallel. + browser-projects: + name: browser-tests (${{ matrix.browser }} ${{ matrix.file }}) runs-on: ubuntu-26.04 timeout-minutes: 10 strategy: - fail-fast: false # report every engine + fail-fast: false # report every project matrix: - browser: [chromium, firefox, webkit] + # Every project in playwright.config.mjs; one missing here isn't tested in CI. + include: + - { browser: chromium, file: pace.js } + - { browser: chromium, file: pace.min.js } + - { browser: firefox, file: pace.min.js } + - { browser: webkit, file: pace.min.js } steps: - uses: actions/checkout@v7.0.1 with: @@ -55,17 +60,17 @@ jobs: - name: Install the browser run: npx playwright install --with-deps --only-shell ${{ matrix.browser }} - - run: npm run test:browsers -- --project="${{ matrix.browser }} *" + - run: npm run test:browsers -- --project="${{ matrix.browser }} ${{ matrix.file }}" - # The required check: passes only if every engine passed, so the required - # checks stay the same when engines change. + # The required check: passes only if every project passed, so the required + # checks stay the same when projects change. browser-tests: - needs: browser-engines + needs: browser-projects if: always() runs-on: ubuntu-26.04 timeout-minutes: 1 steps: - - name: Check that every engine passed + - name: Check that every project passed env: - RESULT: ${{ needs.browser-engines.result }} + RESULT: ${{ needs.browser-projects.result }} run: test "$RESULT" = success diff --git a/playwright.config.mjs b/playwright.config.mjs index 6536c5e..53e8c8f 100644 --- a/playwright.config.mjs +++ b/playwright.config.mjs @@ -3,8 +3,8 @@ import { defineConfig, devices } from '@playwright/test'; const CI = Boolean(process.env.CI); -// CI runs every engine (one job each, picked with --project); locally only Chromium -// (npx playwright install --only-shell chromium). +// CI runs every engine, each project in its own job (listed in .github/workflows/checks.yml); +// locally only Chromium (npx playwright install --only-shell chromium). const browsers = CI ? ['chromium', 'firefox', 'webkit'] : ['chromium']; const devicesByBrowser = { chromium: 'Desktop Chrome', firefox: 'Desktop Firefox', webkit: 'Desktop Safari' };