Skip to content

Commit 92701af

Browse files
committed
Workaround actions/cache@v4 save-always not working as expected
1 parent 01c61dc commit 92701af

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/templates/test-make.template.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,14 @@
131131
key: ${{ runner.os }}-make-cache-${{ needs.xref.outputs.hash }}
132132
fail-on-cache-miss: true
133133
- name: RESTORE TEST RESULT CACHE
134-
uses: actions/cache@v4
134+
uses: actions/cache/restore@v4
135135
with:
136136
path: /home/runner/test-result-cache/
137137
key: ${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ github.run_attempt }}
138138
restore-keys: |
139139
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ needs.xref.outputs.previous_run_attempt }}
140140
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-
141141
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-
142-
save-always: true
143142
- name: PRINT CACHED RESULTS
144143
run: |
145144
set -x
@@ -164,6 +163,11 @@
164163
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }}
165164
touch ${{ env.SUCCESS_PATH }}/checks
166165
fi
166+
- name: SAVE TEST RESULT CACHE
167+
uses: actions/cache/save@v4
168+
with:
169+
path: /home/runner/test-result-cache/
170+
key: ${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ github.run_attempt }}
167171
- name: UPLOAD TEST ARTIFACTS
168172
if: always()
169173
uses: actions/[email protected]

.github/workflows/test-make.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -2400,15 +2400,14 @@ jobs:
24002400
key: ${{ runner.os }}-make-cache-${{ needs.xref.outputs.hash }}
24012401
fail-on-cache-miss: true
24022402
- name: RESTORE TEST RESULT CACHE
2403-
uses: actions/cache@v4
2403+
uses: actions/cache/restore@v4
24042404
with:
24052405
path: /home/runner/test-result-cache/
24062406
key: ${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ github.run_attempt }}
24072407
restore-keys: |
24082408
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ needs.xref.outputs.previous_run_attempt }}
24092409
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-
24102410
${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-
2411-
save-always: true
24122411
- name: PRINT CACHED RESULTS
24132412
run: |
24142413
set -x
@@ -2433,6 +2432,11 @@ jobs:
24332432
RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }}
24342433
touch ${{ env.SUCCESS_PATH }}/checks
24352434
fi
2435+
- name: SAVE TEST RESULT CACHE
2436+
uses: actions/cache/save@v4
2437+
with:
2438+
path: /home/runner/test-result-cache/
2439+
key: ${{ runner.os }}-test-result-cache-${{ needs.xref.outputs.hash }}-rabbitmq_cli-${{ github.run_number }}-${{ github.run_attempt }}
24362440
- name: UPLOAD TEST ARTIFACTS
24372441
if: always()
24382442
uses: actions/[email protected]

0 commit comments

Comments
 (0)