-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (73 loc) · 3.67 KB
/
action.yml
File metadata and controls
75 lines (73 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Get Deployment Paths
description: Action that returns important paths for a spack install on a deployment target.
author: Tommy Gatti
inputs:
spack-installs-root-path:
required: true
# For example, `some/apps/spack` is the root, `some/apps/spack/0.21/` is a specific spack deployment, `some/apps/spack/0.21/spack` is a specific spack install.
description: Path to a directory within which all versions of spack are installed
spack-version:
required: true
description: |
Major branch version of spack deployed, eg. 0.22, 1.0.
Used to construct a specific spack installation path, in conjunction with `spack-installs-root-path`.
deployment-target:
required: true
description: |
Name of the GitHub deployment target. Combined with inputs.deployment-type to form the GitHub Environment name.
For example: Gadi, Setonix
deployment-type:
required: true
description: |
Type of the GitHub deployment target. Combined with inputs.deployment-target to form the GitHub Environment name.
For example: Prerelease, Release
spack-environment:
required: true
description: |
Spack environment name that is used for this deployment.
outputs:
root:
description: |
Path to the root of a specific deployment of `spack`.
This path contains `spack-config` and various `spack-packages` repositories in it's hierarchy as well.
value: ${{ steps.path.outputs.root }}
spack:
description: Path to a specific installation of `spack`.
value: ${{ steps.path.outputs.spack }}
spack-config:
description: Path to the ACCESS-NRI/spack-config repository associated with the install of spack.
value: ${{ steps.path.outputs.spack-config }}
spack-environment:
description: Path to the spack environment folder for the given inputs.spack-environment. Also contains the `spack-packages` repository for Prerelease deployments.
value: ${{ steps.path.outputs.spack-environment }}
# Regarding our other important repository path, spack-packages:
# Release instances of spack-packages are now managed by spack itself via `spack repo` commands, so deployment doesn't actually need to know where it is.
# Prerelease instances of spack-packages are located within the outputs.spack-environment folder, and are removed when that environment is removed, so there is no need to track them either.
runs:
using: composite
steps:
- name: Validate Inputs
id: validate
shell: bash
env:
ACCEPTABLE_DEPLOYMENT_ENVIRONMENT_TARGETS: Release Prerelease
run: |
# Check that the inputs.spack-installs-root-path exists - it's usually a var
if [ -z '${{ inputs.spack-installs-root-path }}' ]; then
echo '::error::inputs.spack-installs-root-path does not exist in ${{ github.repository }}s ${{ inputs.deployment-target }} ${{ inputs.deployment-type }} environment. Check Environment vars.'
exit 1
fi
if [[ ! '${{ env.ACCEPTABLE_DEPLOYMENT_ENVIRONMENT_TARGETS}}' =~ "${{ inputs.deployment-type }}" ]]; then
echo '::error::inputs.deployment-type must be one of ${{ env.ACCEPTABLE_DEPLOYMENT_ENVIRONMENT_TARGETS }}.'
exit 1
fi
echo "type=$type" >> $GITHUB_OUTPUT
- name: Get ${{ inputs.deployment-target }} ${{ inputs.deployment-type }} Remote Paths
id: path
shell: bash
run: |
root=${{ inputs.spack-installs-root-path }}/${{ inputs.spack-version }}
echo "root=$root" >> $GITHUB_OUTPUT
echo "spack=$root/spack" >> $GITHUB_OUTPUT
echo "spack-config=$root/spack-config" >> $GITHUB_OUTPUT
echo "spack-environment=$root/environments/${{ inputs.spack-environment }}" >> $GITHUB_OUTPUT