Skip to content

Commit

Permalink
Only pre-cache on cache miss
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Aug 28, 2024
1 parent 867b79b commit b18e8ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ runs:
# Saving on feature branches will only benefit reruns, so we don't bother.
# Feature branches inherit the cache from the main branch anyway.
# This saves on cache storage.
# if: github.ref == 'refs/heads/main' && steps.restore.outputs.cache-hit != 'true'
if: steps.restore.outputs.cache-hit != 'true' # tmp
# if: github.ref == 'refs/heads/main'
if: steps.restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ env.PURO_ROOT }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/cache/restore@v4
id: cache-check
with:
path: . # not important
lookup-only: true
key: setup-runner-${{ runner.os }}-${{ runner.arch }}-
restore-keys: setup-runner-${{ runner.os }}-${{ runner.arch }}-

- name: Setup runner
if: steps.cache-check.outputs.cache-matched-key == ''
uses: ./.github/actions/setup-runner

build:
Expand Down

0 comments on commit b18e8ea

Please sign in to comment.