-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle the fact the github actions cache does not allows updates
If there is a cache hit, there is never a save. Therefore, we need to always miss on the first run attempt, falling back hopefully to the previous run.
- Loading branch information
Showing
2 changed files
with
8 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,9 +216,10 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }} | ||
key: ${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt - 1 }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}-${{ github.run_number }}- | ||
${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}- | ||
- name: PREP CACHE DIR | ||
run: | | ||
mkdir -p /home/runner/test-result-cache/${{ steps.hash.outputs.hash }} | ||
|
@@ -250,10 +251,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ needs.load-test-result-cache.outputs.hash }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
fail-on-cache-miss: true | ||
key: ${{ runner.os }}-test-result-cache-${{ needs.load-test-result-cache.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | ||
save-always: true | ||
- name: UPDATE CACHE | ||
uses: actions/download-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,10 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }} | ||
key: ${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt - 1 }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}-${{ github.run_number }}- | ||
${{ runner.os }}-test-result-cache-${{ steps.hash.outputs.hash }}- | ||
- name: PREP CACHE DIR | ||
run: | | ||
mkdir -p /home/runner/test-result-cache/${{ steps.hash.outputs.hash }} | ||
|
@@ -6937,10 +6938,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /home/runner/test-result-cache/ | ||
key: ${{ runner.os }}-test-result-cache-${{ needs.load-test-result-cache.outputs.hash }} | ||
restore-keys: | | ||
${{ runner.os }}-test-result-cache- | ||
fail-on-cache-miss: true | ||
key: ${{ runner.os }}-test-result-cache-${{ needs.load-test-result-cache.outputs.hash }}-${{ github.run_number }}-${{ github.run_attempt }} | ||
save-always: true | ||
- name: UPDATE CACHE | ||
uses: actions/download-artifact@v4 | ||
|