Skip to content

Commit

Permalink
Update test pipeline with carsus regression data
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Sep 27, 2024
1 parent e9b424b commit 321c6d4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Setup LFS"
description: "Pull LFS repositories and caches them"


inputs:
regression-data-repo:
description: "carsus regression data repository"
required: false
default: "tardis-sn/carsus-regression-data"

runs:
using: "composite"
steps:
- name: Clone tardis-sn/carsus-regression-data
uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
path: carsus-regression-data

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
working-directory: carsus-regression-data
shell: bash

- name: Restore LFS cache
uses: actions/cache/restore@v4
id: lfs-cache-regression-data
with:
path: carsus-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('carsus-regression-data/.lfs-assets-id') }}-v1

- name: Git LFS Pull
run: git lfs pull
working-directory: carsus-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit != 'true'
shell: bash

- name: Git LFS Checkout
run: git lfs checkout
working-directory: carsus-regression-data
if: steps.lfs-cache-regression-data.outputs.cache-hit == 'true'
shell: bash

- name: Save LFS cache if not found
# uses fake ternary
# for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
if: ${{ steps.lfs-cache-regression-data.outputs.cache-hit != 'true' && !contains(github.ref, 'merge') && always() || false }}
uses: actions/cache/save@v4
id: lfs-cache-regression-data-save
with:
path: carsus-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('carsus-regression-data/.lfs-assets-id') }}-v1
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:
CHIANTI_DL_URL: https://download.chiantidatabase.org
CHIANTI_DB_VER: CHIANTI_v9.0.1_database.tar.gz
PYTEST_FLAGS: --remote-data --refdata=carsus-refdata
--cov=carsus --cov-report=xml --cov-report=html
--cov=carsus --cov-report=xml --cov-report=html --carsus-regression-data=${{ github.workspace }}/carsus-regression-data
NBCONVERT_CMD: jupyter nbconvert --execute --ExecutePreprocessor.timeout=600 --to html
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CMFGEN_DL_URL: http://kookaburra.phyast.pitt.edu/hillier/cmfgen_files
Expand All @@ -51,6 +51,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup LFS
uses: ./.github/actions/setup_lfs

- name: Clone tardis-sn/carsus-refdata
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 321c6d4

Please sign in to comment.