forked from tardis-sn/carsus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test pipeline with carsus regression data
- Loading branch information
1 parent
e9b424b
commit 321c6d4
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters