From bfb5473ad66da2e05239c6c2f3ae25396af34a74 Mon Sep 17 00:00:00 2001 From: Tei Im Date: Tue, 16 Apr 2024 16:14:59 -0600 Subject: [PATCH] Check op-program version in CI --- .github/scripts/check_versions.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/scripts/check_versions.sh b/.github/scripts/check_versions.sh index 01055959..c9266e83 100755 --- a/.github/scripts/check_versions.sh +++ b/.github/scripts/check_versions.sh @@ -11,7 +11,7 @@ echo "Version in go.mod: $go_list_version" cd $submodule_path submodule_version=$(git rev-parse HEAD) echo "Submodule commit: $submodule_version" -cd .. +cd ../../.. # Extract the commit hash from the go_list_version # This regex assumes the hash is always after the last hyphen, which is typical for pseudo-versions @@ -34,8 +34,19 @@ submodule_commit_part=$(echo $submodule_version | cut -c 1-$length) # Compare the two commit parts if [ "$go_list_commit" == "$submodule_commit_part" ]; then - echo "Versions match." + echo "git submodule and go mod versions match." else - echo "Versions do not match." + echo "git submodule and go mod versions do not match." + exit 1 +fi + +op_program_test_version=$(cat tests/op-program-test/VERSION) +echo "op-program commit: $op_program_test_version" + +# Compare the two commit parts +if [ "$op_program_test_version" == "$submodule_version" ]; then + echo "git submodule and op-program versions match." +else + echo "git submodule and op-program versions do not match." exit 1 fi