Skip to content

Commit 241b4c8

Browse files
committed
fix(ci): save the emptied dev cache under its own actions/cache entry
1 parent 2e9d074 commit 241b4c8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎.github/actions/cache/action.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ inputs:
1212
path:
1313
description: Path to mount.
1414
required: true
15+
save-suffix:
16+
description: Appended to the actions/cache save key, for a job that must replace an entry another job of the same run already saved under that key. Sticky disks ignore it.
17+
required: false
18+
default: ''
1519

1620
# Predicates must stay the exact complement of the caller's runs-on — stickydisk
1721
# only runs on Blacksmith.
@@ -31,6 +35,6 @@ runs:
3135
if: inputs.provider != '' && inputs.provider != 'blacksmith'
3236
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
3337
with:
34-
key: ${{ inputs.key }}-${{ github.run_id }}
38+
key: ${{ inputs.key }}-${{ github.run_id }}${{ inputs.save-suffix }}
3539
restore-keys: ${{ inputs.key }}-
3640
path: ${{ inputs.path }}

‎.github/workflows/checks.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,16 @@ jobs:
591591
- *checkout-mirror
592592
- *checkout-plain
593593

594+
# A desktop-live leg that passed may have saved this run's actions/cache entry already; the
595+
# suffix gives the emptied cache its own, newer entry for the next run's prefix restore.
594596
- name: Mount the broken dev cache
595597
if: steps.broken.outputs.key != ''
596598
uses: ./.github/actions/cache
597599
with:
598600
provider: ${{ vars.CI_PROVIDER }}
599601
key: ${{ steps.broken.outputs.key }}
600602
path: ./apps/sim/.next/dev
603+
save-suffix: -reset
601604

602605
- name: Empty the dev cache
603606
if: steps.broken.outputs.key != ''

0 commit comments

Comments
 (0)