Skip to content

Commit

Permalink
Test cache hit
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Jan 27, 2025
1 parent c1c1639 commit 6ee32ba
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/lfs-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ jobs:
key: tardis-regression-${{ inputs.atom-data-sparse == 'true' && 'atom-data-sparse' || 'full-data' }}-${{ hashFiles('tardis-regression-data/.lfs-files-list') }}-${{ inputs.regression-data-repo }}-v1
lookup-only: true

- name: Test cache hit
if: ${{ steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') }}
run: |
echo "Cache hit: ${{ steps.test-lfs-cache-regression-data.outputs.cache-hit }}"
echo "GitHub ref: ${{ github.ref }}"
- name: End
run: |
echo "Ending workflow"
exit 0
- name: Git LFS Pull Atom Data
run: git lfs pull --include-ref=atom_data/kurucz_cd23_chianti_H_He.h5
if: ${{ inputs.atom-data-sparse == true && steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true' }}
Expand All @@ -76,10 +87,7 @@ jobs:

- name: Save LFS cache if not found
uses: actions/cache/save@v4
# uses fake ternary
# for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
if: ${{ steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') && always() || false }}
if: ${{ steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') }}
with:
path: tardis-regression-data/.git/lfs
key: tardis-regression-${{ inputs.atom-data-sparse == true && 'atom-data-sparse' || 'full-data' }}-${{ hashFiles('tardis-regression-data/.lfs-files-list') }}-${{ inputs.regression-data-repo }}-v1

0 comments on commit 6ee32ba

Please sign in to comment.