From 9c21e4fd317abbab8513bcfceb4ce5b9c24c4e16 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Mon, 23 Jan 2023 19:26:41 +0530 Subject: [PATCH 1/6] Cache LFS objects (actions/checkout#165) --- .github/workflows/tests.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9c3c9e2cab..2fa85f0095e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,8 +47,34 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Download reference data - run: bash .ci-helpers/download_reference_data.sh + # - 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 + + - 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 + + - name: see file size + run: ls -lrtsh -a + working-directory: tardis-refdata + - name: Setup environment uses: conda-incubator/setup-miniconda@v2 @@ -72,7 +98,7 @@ jobs: run: pip install -e . - name: Run tests - run: pytest tardis ${{ env.PYTEST_FLAGS }} + run: pytest tardis -x ${{ env.PYTEST_FLAGS }} - name: Upload to Codecov run: bash <(curl -s https://codecov.io/bash) From c591cc58884f2af8d2d9499bfbd15d6f048cea10 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Fri, 27 Jan 2023 16:37:01 +0530 Subject: [PATCH 2/6] Delete steps to see file size Delete commented step which used to download LFS objects using the bash script --- .github/workflows/tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2fa85f0095e..474fed13fd0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,9 +47,6 @@ 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: @@ -71,11 +68,6 @@ jobs: run: git lfs pull working-directory: tardis-refdata - - name: see file size - run: ls -lrtsh -a - working-directory: tardis-refdata - - - name: Setup environment uses: conda-incubator/setup-miniconda@v2 with: From e34f9774ca950590487f8ea0bf0a269dd7582c00 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Mon, 30 Jan 2023 19:17:29 +0530 Subject: [PATCH 3/6] Add lfs:false flag --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 474fed13fd0..5dece040c98 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,6 +52,7 @@ jobs: 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 From d7f17d89cea7e6da115fb4b23755f3f709104526 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Mon, 30 Jan 2023 19:21:03 +0530 Subject: [PATCH 4/6] Add my username to .mailmap --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index c5f66f95c32..469c9342f1b 100644 --- a/.mailmap +++ b/.mailmap @@ -33,6 +33,7 @@ Arjun Savel Arjun Savel <35353555+arjunsavel@users.noreply.gi Atharva Arya Atharva Arya Atharva Arya +Atharva Arya atharva-2001 Atharva Arya Atharva Arya <55894364+atharva-2001@users.noreply.github.com> Atharwa Kharkar From fe9d7298c139d6716c82b9008c5b689d036b1439 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Wed, 8 Feb 2023 17:46:17 +0530 Subject: [PATCH 5/6] Cache hit and allow pytest to run all tests --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5dece040c98..d24cf0bc236 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,6 +68,7 @@ jobs: - name: Git LFS Pull run: git lfs pull working-directory: tardis-refdata + if: steps.lfs-cache.outputs.cache-hit != 'true' - name: Setup environment uses: conda-incubator/setup-miniconda@v2 @@ -91,7 +92,7 @@ jobs: run: pip install -e . - name: Run tests - run: pytest tardis -x ${{ env.PYTEST_FLAGS }} + run: pytest tardis ${{ env.PYTEST_FLAGS }} - name: Upload to Codecov run: bash <(curl -s https://codecov.io/bash) From 8e68779e206ced452693cef26d5c22e64bcda896 Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Mon, 20 Feb 2023 14:43:51 +0530 Subject: [PATCH 6/6] Do git lfs checkout if the cache key is found --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d24cf0bc236..bf5810b368a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,6 +69,11 @@ jobs: 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