Skip to content

Commit 23ec4bb

Browse files
authored
Merge pull request #4506 from tgross35/main-cargo-semver-checks
ci: Run `cargo-semver-checks`
2 parents ec44bd2 + 4011ca8 commit 23ec4bb

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ jobs:
6666
run: |
6767
set -eux
6868
[ "${{ matrix.toolchain }}" = "1.63.0" ] && echo 'RUSTFLAGS=' >> "$GITHUB_ENV" || true
69-
69+
7070
- name: Setup Rust toolchain
7171
run: ./ci/install-rust.sh
7272

73+
- name: Install semver-checks
74+
uses: taiki-e/install-action@cargo-semver-checks
75+
if: matrix.toolchain == 'stable'
76+
7377
# FIXME(ci): These `du` statements are temporary for debugging cache
7478
- name: Target size before restoring cache
7579
run: du -sh target | sort -k 2 || true

ci/verify-build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set -eux
1111

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

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

2728
if [ "$TOOLCHAIN" = "nightly" ] ; then
29+
# For build-std
2830
rustup component add rust-src
2931
fi
3032

@@ -107,6 +109,13 @@ test_target() {
107109
$cmd --no-default-features
108110
done
109111
fi
112+
113+
# FIXME(semver): can't pass `--target` to `cargo-semver-checks`
114+
if [ "$rust" = "stable" ] && [ "$target" = "$host_target" ]; then
115+
# Run semver checks on the stable channel
116+
cargo semver-checks --only-explicit-features \
117+
--features std,extra_traits
118+
fi
110119
}
111120

112121
freebsd_versions="\

ctest/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ impl TestGenerator {
875875
let name = format!("lib{stem}.a");
876876

877877
cfg.try_compile(&name)
878-
.context(format!("failed to compile `{}`", name))
878+
.context(format!("failed to compile `{name}`"))
879879
.map(|_| out)
880880
}
881881

0 commit comments

Comments
 (0)