Skip to content

Commit

Permalink
move cache eviction (#1244)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris <forgetso86@gmail.com>
  • Loading branch information
goastler and forgetso authored May 27, 2024
1 parent 349f0da commit 39a9767
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/post_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,19 @@ jobs:
- run: ls -la protocol/target/ink || true
- run: ls -la node_modules || true

# remove all but the latest cache (this ensures there's at least one cache available for the next run, just in case this takes place while we're clearing up caches)
# this means there will be the previous cache (the latest) and the current cache (the one we're building now) after this workflow finishes
# github actions will prefer the latest cache, so the one output from this workflow will take precedence in future jobs
# save cache to main branch. Any branch can use this cache afterwards to speed up their build
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: |
protocol/cargo-cache
protocol/target
node_modules
~/.cache/Cypress
key: project-cache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}

# remove all but the latest cache, leaving only the cache we just saved
- name: Cleanup caches
if: always()
run: |
Expand All @@ -124,15 +134,3 @@ jobs:
do
gh actions-cache delete $cacheKey -R $REPO --confirm
done
# save cache to main branch. Any branch can use this cache afterwards to speed up their build
- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: |
protocol/cargo-cache
protocol/target
node_modules
~/.cache/Cypress
key: project-cache-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}

0 comments on commit 39a9767

Please sign in to comment.