Skip to content

Playwright

Playwright CI on GitHub Actions

Browser downloads and serial test execution dominate every run.

75s → 3s
Browser install
32m → 6m
E2E suite

Browser downloads and serial test execution dominate every run.

Why it happens

Playwright downloads browser binaries on each run and defaults to limited workers in CI.

What to change

  1. Cache ~/.cache/ms-playwright keyed on the Playwright version
  2. Set workers to the runner core count rather than the CI default of one
  3. Shard across runners with --shard and merge the blob reports
  4. Install only the browsers you actually test

Playwright on runnerhut

yaml
jobs:
e2e:
strategy:
matrix:
shard: [1, 2, 3, 4]
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npx playwright test --shard=${{ matrix.shard }}/4 --workers=8
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.