Skip to content

Commit

Permalink
Merge pull request #84 from atharva-2001/update_compare_refdata
Browse files Browse the repository at this point in the history
Update Compare Refdata With New Action And Other Fixes
  • Loading branch information
jvshields authored Jun 21, 2024
2 parents b53ef34 + 9afb026 commit d48cfbd
Showing 1 changed file with 20 additions and 86 deletions.
106 changes: 20 additions & 86 deletions .github/workflows/compare-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,80 +21,8 @@ jobs:
if: github.repository_owner == 'tardis-sn'
runs-on: ubuntu-latest
steps:
- name: Clone tardis-sn/tardis-regression-data
uses: actions/checkout@v4
with:
repository: tardis-sn/tardis-regression-data
path: tardis-regression-data

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

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

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

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

- 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' && always() || false }}
uses: actions/cache/save@v3
id: lfs-cache-regression-data-save
with:
path: tardis-regression-data/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-regression-data/.lfs-assets-id') }}-v1

- name: Checkout TARDIS refdata
uses: actions/checkout@v4
with:
path: tardis-refdata/
lfs: false
ref: master

- 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/restore@v3
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: Save LFS cache if not found
# uses fake ternary
# for reference: https://github.com/orgs/community/discussions/26738#discussioncomment-3253176
if: ${{ steps.lfs-cache.outputs.cache-hit != 'true' && always() || false }}
uses: actions/cache/save@v3
id: lfs-cache-save
with:
path: tardis-refdata/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1
- name: Setup LFS
uses: tardis-sn/github_action_setup_lfs@v1

- name: Checkout TARDIS (master)
uses: actions/checkout@v4
Expand All @@ -111,20 +39,26 @@ jobs:
path: tardis/
ref: ${{ github.event.client_payload.pull_request.head.ref }}

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: tardis
use-mamba: true

- name: Update environment
working-directory: tardis/
run: mamba update -n tardis --file conda-linux-64.lock
- name: Download Lock File
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock

- name: Generate Cache Key
run: |
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1)
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}"
id: cache-environment-key

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-linux-64.lock
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }}
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }}
environment-name: tardis
cache-environment: true
cache-downloads: true

- name: Install Bokeh
run: mamba install bokeh --channel conda-forge --no-update-deps --yes
run: micromamba install bokeh --channel conda-forge --no-deps --yes

- name: Generate reference data for comparison
working-directory: tardis/
Expand Down

0 comments on commit d48cfbd

Please sign in to comment.