Skip to content

Commit

Permalink
Only save cache on workflows for master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwittenburg committed Jul 28, 2023
1 parent 30e7ff7 commit 296fe28
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,15 @@ jobs:
run: gha/scripts/ci/gh-actions/run.sh build
- name: Print ccache statistics
run: ccache -s
- name: Test
run: gha/scripts/ci/gh-actions/run.sh test
- name: Save cache
uses: actions/cache/save@v3
# if: github.ref_name == 'master'
if: steps.restore-cache.outputs.cache-hit == 'false'
if: github.ref_name == 'master' && steps.restore-cache.outputs.cache-hit == 'false'
id: save-cache
with:
path: .ccache
key: ccache-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.parallel }}-${{ github.sha }}
- name: Test
run: gha/scripts/ci/gh-actions/run.sh test

linux_el8:
needs: [format, git_checks]
Expand Down Expand Up @@ -233,8 +232,7 @@ jobs:
run: ccache -s
- name: Save cache
uses: actions/cache/save@v3
# if: github.ref_name == 'master'
if: steps.restore-cache.outputs.cache-hit == 'false'
if: github.ref_name == 'master' && steps.restore-cache.outputs.cache-hit == 'false'
id: save-cache
with:
path: .ccache
Expand Down Expand Up @@ -301,8 +299,7 @@ jobs:
run: ccache -s
- name: Save cache
uses: actions/cache/save@v3
# if: github.ref_name == 'master'
if: steps.restore-cache.outputs.cache-hit == 'false'
if: github.ref_name == 'master' && steps.restore-cache.outputs.cache-hit == 'false'
id: save-cache
with:
path: .ccache
Expand Down

0 comments on commit 296fe28

Please sign in to comment.