@@ -28,6 +28,11 @@ outputs:
28
28
The spack version from the root spec in the spack manifest file.
29
29
For example, 'release'.
30
30
value : ${{ steps.spec.outputs.version }}
31
+ root-spec-variants :
32
+ description : |
33
+ The variants from the root spec in the spack manifest file.
34
+ For example: '~deterministic'.
35
+ value : ${{ steps.spec.outputs.variants }}
31
36
yq-root-spec :
32
37
description : |
33
38
The yq filter for the root spec of the spack manifest file.
@@ -60,26 +65,29 @@ runs:
60
65
id : spec
61
66
shell : bash
62
67
run : |
63
- # Example: access-om2@git.2025.01.0=release ~variant
68
+ # Example: access-om2@git.2025.01.0=release ~variant +debug some=value
64
69
full=$(yq '${{ steps.yq.outputs.filter }}' ${{ inputs.spack-manifest-path }})
65
70
66
71
# Example of captured groups from the above:
67
72
# name: anything before `@`. Ex: access-om2
68
73
# ref: anything after `@` or `@git.`; but before `=` (for =VERSION syntax) or ` `/`+`/`~` (for variants). Ex: 2025.01.0
69
74
# version: anything after a `=`, but before ` `/`+`/`~` (for variants). Ex: release
70
-
71
- groups_regex='(?<name>.+)@(?:git\\.)?(?<ref>[^=+~ ]+)(?:=(?<version>[^~+ ]+))?.*'
75
+ # variants: anything at the end that contains ` `/`+`/`~` Ex. ~variant +debug some=value
76
+
77
+ groups_regex='(?<name>.+)@(?:git\\.)?(?<ref>[^=+~ ]+)(?:=(?<version>[^~+ ]+))?(?<variants>[~+ ].+)?'
72
78
73
79
groups=$(yq '${{ steps.yq.outputs.filter }} | capture("'"$groups_regex"'")' ${{ inputs.spack-manifest-path }})
74
80
75
81
# Pull values from groups above
76
82
name=$(yq '.name' <<< "$groups")
77
83
ref=$(yq '.ref' <<< "$groups")
78
84
version=$(yq '.version' <<< "$groups")
85
+ variants=$(yq '.variants' <<< "$groups")
79
86
80
- echo "Split '$full' into name: '$name', ref: '$ref', version: '$version'"
87
+ echo "Split '$full' into name: '$name', ref: '$ref', version: '$version', variants: '$variants' "
81
88
82
89
echo "full=$full" >> $GITHUB_OUTPUT
83
90
echo "name=$name" >> $GITHUB_OUTPUT
84
91
echo "ref=$ref" >> $GITHUB_OUTPUT
85
92
echo "version=$version" >> $GITHUB_OUTPUT
93
+ echo "variants=$variants" >> $GITHUB_OUTPUT
0 commit comments