From 031e85c194ae4508f5ad2c34f7ff7171c2c89581 Mon Sep 17 00:00:00 2001 From: Will Manning Date: Thu, 29 Oct 2026 21:37:30 -0400 Subject: [PATCH] ci: key the Playwright browser cache on the runner image and installed version The cache key was `Linux-playwright-`, with the version read from the package.json range. So the ubuntu-26.04 runners in #116 restored WebKit builds made on ubuntu-24.04, which fail to start without Ubuntu 24's libicudata.so.74. And a lock refresh that installs a newer Playwright than the range's floor would restore browsers for the old version; the cache-hit path never installs new ones. Read the version from the installed package, and add the runner image ($ImageOS, e.g. ubuntu24) to the key. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Will Manning --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2956fe..dcfff95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,18 +123,23 @@ jobs: # bumps, hits otherwise. System deps (apt packages) aren't covered by # the cache, so install those separately even on cache hit (~10s vs # ~3min for the full install). + # Key the cache on the installed version, not the range in package.json, + # which a lock refresh can move past, and on the runner image: browser + # builds link against the image's system libraries, so a cache made on + # ubuntu24 fails on ubuntu26. - name: Get Playwright version id: playwright-version run: | - VERSION=$(grep -oE '"@playwright/test": "[^"]+"' package.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - echo "version=$VERSION" >> $GITHUB_OUTPUT + VERSION=$(node -p "require('@playwright/test/package.json').version") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "image=${ImageOS:-unknown}" >> "$GITHUB_OUTPUT" - name: Cache Playwright browsers id: playwright-cache uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }} + key: ${{ runner.os }}-${{ steps.playwright-version.outputs.image }}-playwright-${{ steps.playwright-version.outputs.version }} - name: Install Playwright browsers (cache miss) if: steps.playwright-cache.outputs.cache-hit != 'true'