Skip to content

Commit

Permalink
Cache LFS objects in the tests workflow (#2194)
Browse files Browse the repository at this point in the history
* Cache LFS objects (actions/checkout#165)

* Delete steps to see file size

Delete commented step which used to download LFS objects using the bash script

* Add lfs:false flag

* Add my username to .mailmap

* Cache hit and allow pytest to run all tests

* Do git lfs checkout if the cache key is found
  • Loading branch information
atharva-2001 authored Feb 20, 2023
1 parent 317c130 commit 2e04916
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,33 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Download reference data
run: bash .ci-helpers/download_reference_data.sh
- name: Clone tardis-sn/tardis-refdata
uses: actions/checkout@v2
with:
repository: tardis-sn/tardis-refdata
path: tardis-refdata
lfs: false

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: tardis-refdata

- name: Restore LFS cache
uses: actions/cache@v2
id: lfs-cache
with:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1

- name: Git LFS Pull
run: git lfs pull
working-directory: tardis-refdata
if: steps.lfs-cache.outputs.cache-hit != 'true'

- name: Git LFS Checkout
run: git lfs checkout
working-directory: tardis-refdata
if: steps.lfs-cache.outputs.cache-hit == 'true'

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Arjun Savel <asavel@gmail.com> Arjun Savel <35353555+arjunsavel@users.noreply.gi

Atharva Arya <aryaatharva18@gmail.com>
Atharva Arya <aryaatharva18@gmail.com> Atharva Arya <aryaa_1@rknec.edu>
Atharva Arya <aryaatharva18@gmail.com> atharva-2001 <aryaa_1@rknec.edu>
Atharva Arya <aryaatharva18@gmail.com> Atharva Arya <55894364+atharva-2001@users.noreply.github.com>

Atharwa Kharkar <atharwa.kharkar19@vit.edu>
Expand Down

0 comments on commit 2e04916

Please sign in to comment.