Skip to content

Commit

Permalink
ci.yml: Updated splitting logic, added better error logs, added TODO (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeGat authored May 23, 2024
1 parent 831337a commit 06ed17b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ jobs:
# this step checks that the versions of the packages themselves match with the
# names of the modules. For example, [email protected] matches with the
# modulefile access-om3/2023.12.12 (specifically, the version strings match)
# TODO: Move this into the `scripts` directory - it's getting unweildly.
run: |
FAILED='false'
DEPS=$(yq ".spack.modules.default.tcl.include | join(\" \")" spack.yaml)
Expand All @@ -138,13 +139,15 @@ jobs:
if [[ "$DEP" == "${{ needs.defaults.outputs.root-sbd }}" ]]; then
DEP_VER=$(yq '.spack.specs[0] | split("@git.") | .[1]' spack.yaml)
else
DEP_VER=$(yq ".spack.packages.\"$DEP\".require[0] | split(\"@git.\") | .[1]" spack.yaml)
# Capture the section after '@git.' or '@' (if it's not a git-attributed version) for a given dependency.
# Ex. '@git.2024.02.11' -> '2024.02.11', '@access-esm1.5' -> 'access-esm1.5'
DEP_VER=$(yq ".spack.packages.\"$DEP\".require[0] | match(\"^@(?:git.)?(.*)\").captures[0].string" spack.yaml)
fi
MODULE_VER=$(yq ".spack.modules.default.tcl.projections.\"$DEP\" | split(\"/\") | .[1]" spack.yaml)
if [[ "$DEP_VER" != "$MODULE_VER" ]]; then
echo "::error::Version of dependency and projection do not match ($DEP_VER != $MODULE_VER)"
echo "::error::$DEP: Version of dependency and projection do not match ($DEP_VER != $MODULE_VER)"
FAILED='true'
fi
done
Expand Down

0 comments on commit 06ed17b

Please sign in to comment.