@@ -276,11 +276,14 @@ jobs:
276276 id : runner-image
277277 run : echo "version=$ImageOS-$ImageVersion" >> "$GITHUB_OUTPUT"
278278
279+ # Restores the newest saved set by prefix. A cache key is never overwritten, so a run that had
280+ # to add packages saves a new one below.
279281 - name : Restore browser system packages
280- uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
282+ uses : actions/cache/restore @55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
281283 with :
282284 path : ~/.cache/playwright-apt
283- key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}
285+ key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-${{ github.run_id }}-${{ github.run_attempt }}
286+ restore-keys : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-
284287
285288 # Migrations create their own extensions, as on a fresh self-hosted install.
286289 - name : Provision the database through migrations
@@ -336,6 +339,21 @@ jobs:
336339 working-directory : apps/sim
337340 run : PLAYWRIGHT_APT_CACHE="$HOME/.cache/playwright-apt" bash ../../.github/scripts/http-e2e.sh "${{ matrix.group }}"
338341
342+ - name : Check for new browser system packages
343+ id : apt-cache
344+ run : |
345+ if [ -f "$HOME/.cache/playwright-apt/.updated" ]; then
346+ rm "$HOME/.cache/playwright-apt/.updated"
347+ echo 'updated=true' >> "$GITHUB_OUTPUT"
348+ fi
349+
350+ - name : Save browser system packages
351+ if : steps.apt-cache.outputs.updated == 'true'
352+ uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
353+ with :
354+ path : ~/.cache/playwright-apt
355+ key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-${{ github.run_id }}-${{ github.run_attempt }}
356+
339357 - name : Upload acceptance timing and coverage reports
340358 if : always()
341359 uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
0 commit comments