From 1bab51070f4adb5165a517443082480e83a67d00 Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Tue, 27 Oct 2026 18:09:11 +0100 Subject: [PATCH] ci(e2e): restore the previous image's apt debs when the runner image changes Add restore-keys on the apt deb cache so an image change restores the previous debs and install-deps fetches only the delta. On the miss path, autoclean and clear stale debs so the saved cache holds the current set. Closes #1541 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/frontend-e2e.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/frontend-e2e.yml b/.github/workflows/frontend-e2e.yml index d63a8eda..e01abd59 100644 --- a/.github/workflows/frontend-e2e.yml +++ b/.github/workflows/frontend-e2e.yml @@ -99,6 +99,10 @@ jobs: # Keyed on the runner image too: the packages come partly from # noble-updates, so debs cached on an older image can go stale. key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright.outputs.version }}-${{ steps.playwright.outputs.image }}-chromium-apt + # #1541: after a runner image change the exact key misses, but the + # fonts never change and were the slow downloads in #1538, so restore + # the previous image's debs and let install-deps fetch only the delta. + restore-keys: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright.outputs.version }}- - name: Install Chromium system deps id: apt-deps @@ -123,6 +127,9 @@ jobs: npx playwright install-deps chromium if [ "${APT_CACHE_HIT}" != 'true' ]; then mkdir -p "${HOME}/.cache/playwright-apt" + # Drop obsolete versions so the saved cache holds only the current set. + sudo apt-get autoclean -y + rm -f "${HOME}"/.cache/playwright-apt/*.deb cp /var/cache/apt/archives/*.deb "${HOME}/.cache/playwright-apt/" 2>/dev/null || true count="$(find "${HOME}/.cache/playwright-apt" -name '*.deb' | wc -l | tr -d ' ')" echo "debs to cache: ${count}"