Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cargo build and test built binary to ensure it works #246

Merged
merged 3 commits into from
Dec 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,27 @@ jobs:
- name: test
run: cargo test

- name: Run binary on crate pairs
run: |
cargo build
run_binary_on_crate_pair() {
pushd "test_crates/$1/new"
../../../target/debug/cargo-semver-checks semver-checks check-release --baseline-root=../old/Cargo.toml > /dev/null 2>&1
return_value="$?"
popd
return "$return_value"
}
if ! run_binary_on_crate_pair template; then
echo "Running on template crate pair returns a non-zero code, whereas it should end successfully"
exit 1
fi
for crate_pair in "enum_missing" "function_const_removed" "function_unsafe_added"; do
if run_binary_on_crate_pair $crate_pair; then
echo "Running on $crate_pair crate pair ended successfully, whereas it should return a non-zero code"
exit 1
fi
done

run-on-rust-libp2p:
# Run cargo-semver-checks on a crate with no semver violations,
# to make sure there are no false-positives.
Expand Down