From 5e16e80993e23b3a03219801ef225cf7f6a43dc9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2020 02:27:51 +0000 Subject: [PATCH] CI: Check monorepo for consistent crate versions (bp #13431) (#13432) * increment-cargo-version.sh: Add check subcommand (cherry picked from commit 5d4015358a0c6743a8b7db4ef57aa9481fb9d227) * CI: Check monorepo for consistent crate versions (cherry picked from commit 7a4e293b3b99e1cafe137ca89322c9a3084b2066) Co-authored-by: Trent Nelson --- ci/test-checks.sh | 2 ++ scripts/increment-cargo-version.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 023e77cbf7..9ef9f49a35 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -9,6 +9,8 @@ source ci/rust-version.sh stable source ci/rust-version.sh nightly eval "$(ci/channel-info.sh)" +scripts/increment-cargo-version.sh check + echo --- build environment ( set -x diff --git a/scripts/increment-cargo-version.sh b/scripts/increment-cargo-version.sh index c5eaf9f398..19e7f65e32 100755 --- a/scripts/increment-cargo-version.sh +++ b/scripts/increment-cargo-version.sh @@ -90,6 +90,19 @@ minor) ;; dropspecial) ;; +check) + badTomls=() + for Cargo_toml in "${Cargo_tomls[@]}"; do + if ! grep "^version *= *\"$currentVersion\"$" "$Cargo_toml" &>/dev/null; then + badTomls+=("$Cargo_toml") + fi + done + if [[ ${#badTomls[@]} -ne 0 ]]; then + echo "Error: Incorrect crate version specified in: ${badTomls[*]}" + exit 1 + fi + exit 0 + ;; -*) if [[ $1 =~ ^-[A-Za-z0-9]*$ ]]; then SPECIAL="$1"