Skip to content

Commit c5a6328

Browse files
committed
ci: add verifier for internal dependency version
1 parent 9e86a92 commit c5a6328

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Check that symbolic_regression depends on the correct version of dynamic_expressions
5+
6+
DE_VERSION=$(grep -m1 '^version' dynamic_expressions/Cargo.toml | cut -d'"' -f2)
7+
SR_DEP_VERSION=$(grep '^dynamic_expressions' symbolic_regression/Cargo.toml | cut -d'"' -f2)
8+
9+
echo "dynamic_expressions version: $DE_VERSION"
10+
echo "symbolic_regression depends on dynamic_expressions: $SR_DEP_VERSION"
11+
12+
if [ "$DE_VERSION" != "$SR_DEP_VERSION" ]; then
13+
echo "❌ ERROR: Version mismatch!"
14+
echo " symbolic_regression must depend on dynamic_expressions = \"$DE_VERSION\""
15+
echo " but it currently depends on \"$SR_DEP_VERSION\""
16+
echo ""
17+
echo " Update symbolic_regression/Cargo.toml line:"
18+
echo " dynamic_expressions = \"$DE_VERSION\""
19+
exit 1
20+
fi
21+
22+
echo "✅ Workspace dependency versions are in sync"

.github/workflows/publish-crates.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
with:
2424
ref: ${{ inputs.git_ref }}
2525

26+
- name: Check workspace dependency versions
27+
run: .github/scripts/check-workspace-deps.sh
28+
2629
- name: Install Rust
2730
uses: actions-rust-lang/setup-rust-toolchain@v1
2831
with:

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"plugins": ["cargo-workspace"],
23
"packages": {
34
"dynamic_expressions": {
45
"release-type": "rust",

0 commit comments

Comments
 (0)