Skip to content

Commit

Permalink
Create LFS files
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Jan 27, 2025
1 parent 1543d04 commit bbbf8f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runs:
repository: ${{ inputs.regression-data-repo }}
path: tardis-regression-data
sparse-checkout: ${{ inputs.atom-data-sparse == 'true' && 'atom_data/kurucz_cd23_chianti_H_He.h5' || '' }}
lfs: false

- name: Create LFS file list
run: |
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/lfs-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ on:
required: false
default: "tardis-sn/tardis-regression-data"
type: string
lfs-files-list:
description: "LFS files list"
required: false
type: string

defaults:
run:
Expand All @@ -38,12 +34,23 @@ jobs:
repository: ${{ inputs.regression-data-repo }}
path: tardis-regression-data
sparse-checkout: ${{ inputs.atom-data-sparse == 'true' && 'atom_data/kurucz_cd23_chianti_H_He.h5' || '' }}

- name: Create LFS file list
run: |
if [ "${{ inputs.atom-data-sparse }}" == "true" ]; then
echo "Using atom data sparse checkout"
echo "atom_data/kurucz_cd23_chianti_H_He.h5" > .lfs-files-list
else
echo "Using full repository checkout"
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-files-list
fi
working-directory: tardis-regression-data

- name: Print files
run: |
echo ${{ inputs.lfs-files-list }}
echo ${{ inputs.atom-data-sparse }}
echo ${{ inputs.regression-data-repo }}
echo ${{ hashFiles('tardis-regression-data/.lfs-files-list') }}
- name: Test cache availability
uses: actions/cache/restore@v4
Expand All @@ -57,21 +64,19 @@ jobs:
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' }}
working-directory: tardis-regression-data
shell: bash

- name: Git LFS Pull Full Data
run: git lfs pull
if: ${{ inputs.atom-data-sparse == 'false' && steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true' }}
working-directory: tardis-regression-data
shell: bash

- name: Git LFS Checkout
run: git lfs checkout
working-directory: tardis-regression-data
shell: bash

- name: Save LFS cache if not found
uses: actions/cache/save@v4
if: steps.test-lfs-cache-regression-data.outputs.cache-hit != 'true'
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
Expand Down

0 comments on commit bbbf8f4

Please sign in to comment.