diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 74a053b..97fe366 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,7 +35,14 @@ jobs: browser-projects: name: browser-tests (${{ matrix.browser }} ${{ matrix.file }}) runs-on: ubuntu-26.04 - timeout-minutes: 10 + timeout-minutes: 5 + # Playwright's image comes with its browsers and the system packages they need + # (https://playwright.dev/docs/ci#via-containers), so nothing is installed here. + # Its version must match @playwright/test in package.json, or the tests fail + # to find their browsers. Pinned by digest, like the actions in actions.lock. + container: + image: mcr.microsoft.com/playwright:v1.64.1-noble@sha256:2f05f8a734509a7b3f26a912639488ee08f58a7b292d14d62271bcff9038768f + options: --user 1001 strategy: fail-fast: false # report every project matrix: @@ -56,10 +63,6 @@ jobs: - run: npm ci - # Not cached: Playwright's docs say restoring takes about as long as downloading. - - name: Install the browser - run: npx playwright install --with-deps --only-shell ${{ matrix.browser }} - - run: npm run test:browsers -- --project="${{ matrix.browser }} ${{ matrix.file }}" # The required check: passes only if every project passed, so the required diff --git a/playwright.config.mjs b/playwright.config.mjs index 53e8c8f..ae0fa91 100644 --- a/playwright.config.mjs +++ b/playwright.config.mjs @@ -15,7 +15,10 @@ const filesByBrowser = { chromium: ['pace.js', 'pace.min.js'], firefox: ['pace.m export default defineConfig({ testDir: 'tests', forbidOnly: CI, - workers: CI ? 1 : undefined, + // The tests spend their time waiting for pace's timers and their own requests, not on the + // CPU, so they run in parallel, also within a file; on CI, one worker per CPU core. + fullyParallel: true, + workers: CI ? '100%' : undefined, reporter: CI ? [['github'], ['list']] : 'list', projects: browsers.flatMap((browser) => filesByBrowser[browser].map((paceFile) => ({