Skip to content

Commit

Permalink
ci: Avoid saving the same Ccache cache
Browse files Browse the repository at this point in the history
This occurred when a job was being rerun.
  • Loading branch information
hebasto committed Sep 1, 2023
1 parent 14e5de6 commit f2d4e51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"

- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CCACHE_DIR }}
Expand All @@ -63,7 +64,7 @@ jobs:

- name: Save Ccache cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
Expand Down Expand Up @@ -203,6 +204,7 @@ jobs:
Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"
- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v3
with:
path: ~/AppData/Local/ccache
Expand Down Expand Up @@ -243,7 +245,7 @@ jobs:

- name: Save Ccache cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ~/AppData/Local/ccache
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
Expand Down

0 comments on commit f2d4e51

Please sign in to comment.