From 4156344923d2c5ac8005706f5dbd31a4e89db333 Mon Sep 17 00:00:00 2001 From: Tim Morgan Date: Mon, 31 Aug 2026 18:21:41 -0700 Subject: [PATCH] Cache Playwright browser downloads in CI The e2e job downloaded roughly 350 MB of browser builds on every push and pull request. `cache: pnpm` does not cover them: the browsers live in ~/.cache/ms-playwright, outside the pnpm store. The `playwright install` command is left exactly as it was. It skips browser revisions already present, so a warm cache makes it cheap, and it must keep running to install the apt system libraries the cache does not cover -- conditionalising it on a cache hit would break e2e precisely when the cache works. Keyed on the lockfile hash rather than an extracted Playwright version: a silent parse failure after a future lockfile format change would pin one entry forever and serve wrong-version browsers. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01SRgQmnzeh3vsVKudXWs3RV --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac736f4..1c56374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,11 @@ jobs: node-version-file: .nvmrc - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Cache Playwright browsers + uses: actions/cache@v6 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} # Fourtiles' Playwright config runs chromium, firefox and webkit, so all # three browsers are installed rather than chromium alone. - name: Install Playwright Browsers