@@ -41,14 +41,39 @@ jobs:
4141 # Exclude codelab exercises as they are intentionally made to fail
4242 # Exclude maven conformance tests. They are only executed when there's changes to version.
4343 run : bazelisk test ... --deleted_packages=//codelab/src/test/codelab --test_output=errors --test_tag_filters=-conformance_maven --build_tag_filters=-conformance_maven
44+
45+ # -- Start of Maven Conformance Tests (Ran only when there's version changes) --
4446 - name : Get changed file
4547 id : changed_file
4648 uses : tj-actions/changed-files@v44
4749 with :
4850 files : publish/cel_version.bzl
51+ - name : Verify Version Consistency
52+ if : steps.changed_file.outputs.any_changed == 'true'
53+ run : |
54+ CEL_VERSION=$(grep 'CEL_VERSION =' publish/cel_version.bzl | cut -d '"' -f 2)
55+
56+ MODULE_VERSION=$(grep 'dev.cel:cel' MODULE.bazel | cut -d '"' -f 2 | cut -d ':' -f 3)
57+
58+ if [ -z "$CEL_VERSION" ] || [ -z "$MODULE_VERSION" ]; then
59+ echo "❌ Error: Could not extract one or both version strings."
60+ exit 1
61+ fi
62+
63+ echo "Version in publish/cel_version.bzl: ${CEL_VERSION}"
64+ echo "Version in MODULE.bazel: ${MODULE_VERSION}"
65+
66+ if [ "$CEL_VERSION" != "$MODULE_VERSION" ]; then
67+ echo "❌ Error: Version mismatch between files!"
68+ exit 1
69+ fi
70+
71+ echo "✅ Versions match."
4972 - name : Run Conformance Maven Test on Version Change
5073 if : steps.changed_file.outputs.any_changed == 'true'
5174 run : bazelisk test //conformance/src/test/java/dev/cel/conformance:conformance_maven --test_output=errors
75+
76+ # -- End of Maven Conformance Tests --
5277 - name : Unwanted Dependencies
5378 run : .github/workflows/unwanted_deps.sh
5479 - run : echo "🍏 This job's status is ${{ job.status }}."
0 commit comments