Skip to content

Commit

Permalink
ci(dataverse): clear cache before trying to save to it again
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed May 28, 2023
1 parent e6bc0e4 commit c582de2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/maven_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,25 @@ jobs:
-DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
jacoco:report coveralls:report
# We don't want to cache the WAR file, so delete it
- run: rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
# Prepare to replace the cache. Also: we don't want to cache the WAR file, so delete it
- id: clear-cache
if: ${{ steps.restore-m2-cache.outputs.cache-hit }}
continue-on-error: true # This is not crucial, just carry on
env:
GH_TOKEN: ${{ github.token }}
run: |
rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ steps.restore-m2-cache.outputs.cache-primary-key }} --confirm
# To cache built Maven submodules, summon the save to cache action
- name: Save Maven packages in Cache
uses: actions/cache/save@v3
if: always() # Try to save cache, will not fail if key still exists because clean failed
with:
path: ~/.m2
key: ${{ steps.restore-m2-cache.outputs.cache-primary-key }}-${{ github.run_id }}
key: ${{ steps.restore-m2-cache.outputs.cache-primary-key }}
push-app-img:
name: Publish App Image
permissions:
Expand Down

0 comments on commit c582de2

Please sign in to comment.