Skip to content

[0.2] ci: Run cargo-semver-checks #4504

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

Merged
merged 2 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ jobs:
run: |
set -eux
[ "${{ matrix.toolchain }}" = "1.63.0" ] && echo 'RUSTFLAGS=' >> "$GITHUB_ENV" || true

- name: Setup Rust toolchain
run: ./ci/install-rust.sh

- name: Install semver-checks
uses: taiki-e/install-action@cargo-semver-checks
if: matrix.toolchain == 'stable'

# FIXME(ci): These `du` statements are temporary for debugging cache
- name: Target size before restoring cache
run: du -sh target | sort -k 2 || true
Expand Down
10 changes: 9 additions & 1 deletion ci/verify-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -eux

rust="$TOOLCHAIN"
filter="${FILTER:-}"
host_target=$(rustc -vV | awk '/^host/ { print $2 }')

case "$(uname -s)" in
Linux*) os=linux ;;
Expand All @@ -25,6 +26,7 @@ esac
echo "Testing Rust $rust on $os"

if [ "$TOOLCHAIN" = "nightly" ] ; then
# For build-std
rustup component add rust-src
fi

Expand Down Expand Up @@ -69,7 +71,6 @@ test_target() {

# Test with expected combinations of features
$cmd
$cmd --features const-extern-fn
$cmd --features extra_traits

if [ "$os" = "linux" ]; then
Expand Down Expand Up @@ -108,6 +109,13 @@ test_target() {
$cmd --no-default-features
done
fi

# FIXME(semver): can't pass `--target` to `cargo-semver-checks`
if [ "$rust" = "stable" ] && [ "$target" = "$host_target" ]; then
# Run semver checks on the stable channel
cargo semver-checks --only-explicit-features \
--features std,extra_traits
fi
}

freebsd_versions="\
Expand Down