@@ -271,11 +271,14 @@ jobs:
271271 id : runner-image
272272 run : echo "version=$ImageOS-$ImageVersion" >> "$GITHUB_OUTPUT"
273273
274+ # Restores the newest saved set by prefix. A cache key is never overwritten, so a run that had
275+ # to add packages saves a new one below.
274276 - name : Restore browser system packages
275- uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
277+ uses : actions/cache/restore @55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
276278 with :
277279 path : ~/.cache/playwright-apt
278- key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}
280+ key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-${{ github.run_id }}-${{ github.run_attempt }}
281+ restore-keys : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-
279282
280283 # Migrations create their own extensions, as on a fresh self-hosted install.
281284 - name : Provision the database through migrations
@@ -331,6 +334,21 @@ jobs:
331334 working-directory : apps/sim
332335 run : PLAYWRIGHT_APT_CACHE="$HOME/.cache/playwright-apt" bash ../../.github/scripts/http-e2e.sh "${{ matrix.group }}"
333336
337+ - name : Check for new browser system packages
338+ id : apt-cache
339+ run : |
340+ if [ -f "$HOME/.cache/playwright-apt/.updated" ]; then
341+ rm "$HOME/.cache/playwright-apt/.updated"
342+ echo 'updated=true' >> "$GITHUB_OUTPUT"
343+ fi
344+
345+ - name : Save browser system packages
346+ if : steps.apt-cache.outputs.updated == 'true'
347+ uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
348+ with :
349+ path : ~/.cache/playwright-apt
350+ key : playwright-apt-${{ steps.runner-image.outputs.version }}-${{ hashFiles('bun.lock') }}-${{ matrix.group }}-${{ github.run_id }}-${{ github.run_attempt }}
351+
334352 - name : Upload acceptance timing and coverage reports
335353 if : always()
336354 uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
0 commit comments