Skip to content

Commit

Permalink
Do not save on cache hit (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo authored Mar 13, 2023
1 parent 37154ff commit 1ea72ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ runs:
id: find-gnat
run: gnat --version && echo "available=true" >> $GITHUB_OUTPUT || echo "available=false" >> $GITHUB_OUTPUT

# Setup a GNAT if necessary to build from branch
# Setup a GNAT if necessary to build from branch.
# We cannot use alr-install or setup-alire, as that creates infinite recursion.
- name: Install GNAT
if: inputs.branch != '' && steps.find-gnat.outputs.available != 'true' && steps.cache-alr.outputs.cache-hit != 'true'
uses: ada-actions/toolchain@ce2020
Expand Down Expand Up @@ -99,8 +100,9 @@ runs:
# Save cache early so we can verify its proper working in a test workflow. Otherwise
# it's not saved until workflow completion and by then it's too late.
# When cache was hit, attempting to save will fail and emit a warning, so avoid it.
- name: Cache install
if: ${{ inputs.cache == 'true' && inputs.toolchain_dir == '' }}
if: ${{ inputs.cache == 'true' && inputs.toolchain_dir == '' && steps.cache-alr.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
with:
path: |
Expand Down

0 comments on commit 1ea72ad

Please sign in to comment.