From 1a6fd75899067d31fa71d3ceef26732b57ea5012 Mon Sep 17 00:00:00 2001 From: chad Date: Thu, 12 May 2022 15:50:53 -0500 Subject: [PATCH] .github/: Add Semver to CI steps (#2635) --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53613220bf4d..ad7bfffcf266 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,3 +172,26 @@ jobs: - name: Check formatting run: cargo fmt -- --check + + rustsemver: + runs-on: ubuntu-latest + steps: + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-20 + override: true + components: rustc-dev,llvm-tools-preview + + - name: Install semver + run: cargo install semver + + - name: Fetch the version in the manifest + run: eval "current_version=$(grep -e '^version = .*$' Cargo.toml | cut -d ' ' -f 3)" + + - name: Enforce semantic versioning + run: cargo semver | tee semver_out + + - name: Check for semantic versioning errors + run: (head -n 1 semver_out | grep "\-> $current_version") || (echo "versioning mismatch" && return 1)