-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move setup environment steps to composite action (#2698)
* Test moving setup environment steps to composite action file * Replace steps with action in other docs pre release and update refdata
- Loading branch information
1 parent
c551220
commit 5d22754
Showing
5 changed files
with
49 additions
and
67 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,32 @@ | ||
name: "Setup environment" | ||
description: "Sets up environment for tardis and caches it" | ||
|
||
inputs: | ||
os-label: | ||
description: "os label for lock file, default linux" | ||
required: true | ||
default: "linux" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- 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 |
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
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
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
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