-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b469c23
commit d029d4a
Showing
3 changed files
with
188 additions
and
79 deletions.
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,127 @@ | ||
name: "Setup TARDIS" | ||
description: "Sets up regression/refdata and environment" | ||
|
||
inputs: | ||
os-label: | ||
description: "os label for lock file, default linux" | ||
required: true | ||
default: "linux" | ||
refdata-repo: | ||
description: "tardis refdata repository" | ||
required: false | ||
default: "tardis-sn/tardis-refdata" | ||
regression-data-repo: | ||
description: "tardis regression data repository" | ||
required: false | ||
default: "tardis-sn/tardis-regression-data" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Clone Refdata Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.refdata-repo }} | ||
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 | ||
shell: bash | ||
|
||
- name: Restore LFS cache | ||
uses: actions/cache/restore@v4 | ||
id: lfs-cache-refdata | ||
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-refdata.outputs.cache-hit != 'true' | ||
shell: bash | ||
|
||
- name: Git LFS Checkout | ||
run: git lfs checkout | ||
working-directory: tardis-refdata | ||
if: steps.lfs-cache-refdata.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-refdata.outputs.cache-hit != 'true' && always() || false }} | ||
uses: actions/cache/save@v4 | ||
id: lfs-cache-refdata-save | ||
with: | ||
path: tardis-refdata/.git/lfs | ||
key: ${{ runner.os }}-lfs-${{ hashFiles('tardis-refdata/.lfs-assets-id') }}-v1 | ||
|
||
- name: Clone tardis-sn/tardis-regression-data | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.regression-data-repo }} | ||
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 | ||
shell: bash | ||
|
||
- name: Restore LFS cache | ||
uses: actions/cache/restore@v4 | ||
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' | ||
shell: bash | ||
|
||
- name: Git LFS Checkout | ||
run: git lfs checkout | ||
working-directory: tardis-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' && always() || false }} | ||
uses: actions/cache/save@v4 | ||
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: Download Lock File | ||
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-${{ inputs.os-label }}.lock | ||
if: matrix.pip == true | ||
shell: bash | ||
|
||
- name: Generate Cache Key | ||
run: | | ||
file_hash=$(cat conda-${{ inputs.os-label }}.lock | shasum -a 256 | cut -d' ' -f1) | ||
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}" | ||
id: cache-environment-key | ||
shell: bash | ||
|
||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: conda-${{ inputs.os-label }}.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 package editable | ||
shell: bash | ||
run: | | ||
pip install -e . |
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,32 @@ | ||
name: main | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
matrix: | ||
if: github.repository_owner == 'tardis-sn' | ||
strategy: | ||
# super important if you want to see all results, even if one fails | ||
# fail-fast is true by default | ||
fail-fast: false | ||
matrix: | ||
label: [osx-arm64, linux-64] | ||
include: | ||
- label: osx-arm64 | ||
os: macos-latest | ||
prefix: /Users/runner/miniconda3/envs/tardis | ||
|
||
- label: linux-64 | ||
os: ubuntu-latest | ||
prefix: /usr/share/miniconda3/envs/tardis | ||
|
||
uses: ./.github/workflows/new_tests.yml # calls the one above ^ | ||
with: | ||
run_label: ${{ matrix.label }} | ||
secrets: inherit |
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