diff --git a/.circleci/config.yml b/.circleci/config.yml index d64012ad95..331b677382 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -727,6 +727,22 @@ jobs: - clear_environment: cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache + check-cargo-semver-checks: + executor: rust-docker + resource_class: << pipeline.parameters.twoxlarge >> + steps: + - checkout: + method: full + - setup_environment: + cache_key: v4.2.0-rust-1.88.0-cargo-semver-checks-cache + - run: + name: Check for semver violations + no_output_timeout: 15m + command: | + bash ./.circleci/semver-checks.sh + - clear_environment: + cache_key: v4.2.0-rust-1.88.0-cargo-semver-checks-cache + check-clippy: executor: rust-docker resource_class: << pipeline.parameters.medium >> @@ -850,6 +866,14 @@ workflows: - testnet - mainnet - staging + - check-cargo-semver-checks: + filters: + branches: + only: + - canary + - testnet + - mainnet + - staging snarkos-workflow: jobs: diff --git a/.circleci/semver-checks.sh b/.circleci/semver-checks.sh new file mode 100755 index 0000000000..055ca58749 --- /dev/null +++ b/.circleci/semver-checks.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +set -x + +BASELINE_REV=5233959ad4 # UPDATE ME ON NECESSARY BREAKING CHANGES + +# Ensure that the command is installed. +cargo install cargo-semver-checks@0.43.0 --locked + +# Ensure we can find the baseline revision +git fetch --unshallow || true + +cargo semver-checks --workspace --default-features --baseline-rev $BASELINE_REV