Skip to content

Commit 62c4c15

Browse files
committed
validate-deployment-settings action: Removed check that all versions in release are in prerelease, updated hash equality check to exclude majors that are not in both pre/release
1 parent c906da2 commit 62c4c15

File tree

1 file changed

+10
-16
lines changed
  • .github/actions/validate-deployment-settings

1 file changed

+10
-16
lines changed

.github/actions/validate-deployment-settings/action.yml

+10-16
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,26 @@ runs:
3838
echo "msg=$msg" >> $GITHUB_OUTPUT
3939
fi
4040
41-
- name: Check All Spack Major Versions in Release are in Prerelease
42-
id: spack-maj-all-rel-in-pre
43-
shell: bash
44-
run: |
45-
majors_only_in_release=$(jq --compact-output --raw-output \
46-
'.deployment.${{ inputs.target }} | (.Release.spack | keys) - (.Prerelease.spack | keys) | @sh' \
47-
${{ inputs.settings-path }}
48-
)
49-
50-
if [[ "$majors_only_in_release" != "" ]]; then
51-
msg="Spack versions ${majors_only_in_release} do not exist in Prerelease. Spack versions in Release should be tested in Prerelease first."
52-
echo "::${{ inputs.error-level }}::$msg"
53-
echo "msg=$msg" >> $GITHUB_OUTPUT
54-
fi
55-
5641
- name: Check All Spack Hash Versions are Equal
5742
id: spack-hash-all-equal
5843
shell: bash
44+
# This step gets all the 'major-version: hash' entries for both Release and Prerelease (Ex for Release: [{"0.20": "92e3h3e9"}, ...]).
45+
# It then merges them together based on major version (Ex. [[{"0.20": "u298rer3", "0.20": "r98u349u"}], ...]).
46+
# And then finally compares the hashes for each major version, and returns the major versions where they differ.
5947
run: |
6048
release_version_hashes=$(jq '.deployment.${{ inputs.target }}.Release.spack | to_entries' ${{ inputs.settings-path }})
6149
prerelease_version_hashes=$(jq '.deployment.${{ inputs.target }}.Prerelease.spack | to_entries' ${{ inputs.settings-path }})
6250
6351
unequal_hashes_for_version=$(jq --compact-output --raw-output --null-input \
6452
--argjson r "$release_version_hashes" \
6553
--argjson p "$prerelease_version_hashes" \
66-
'$r + $p | [group_by(.key)[] | select(.[0].value != .[1].value) | .[0].key] | @sh'
54+
'$r + $p
55+
| [
56+
group_by(.key)[]
57+
| select(.[0] != null and .[1] != null and .[0].value != .[1].value)
58+
| .[0].key
59+
]
60+
| @sh'
6761
)
6862
6963
if [[ "$unequal_hashes_for_version" != "" ]]; then

0 commit comments

Comments
 (0)