Skip to content

Commit ea0e4eb

Browse files
committed
Test version consistency
1 parent f3ea27b commit ea0e4eb

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/workflow.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 }}."

publish/cel_version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
"""Maven artifact version for CEL."""
15-
CEL_VERSION = "0.10.1"
15+
CEL_VERSION = "0.11.0-SNAPSHOT"

0 commit comments

Comments
 (0)