Skip to content

Commit 27f7866

Browse files
committed
ci: Add a way to skip semver checks
Include the following in the PR body: ci: ignore-semver And semver checks should be skipped.
1 parent 73d83da commit 27f7866

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ env:
1313
RUSTDOCFLAGS: -Dwarnings
1414
RUSTFLAGS: -Dwarnings
1515
RUST_BACKTRACE: full
16+
# Skip semver checks if specified. This implementation is a bit crude but
17+
# seems to work.
18+
SEMVER_CHECKS: >
19+
${{ contains(github.event.pull_request.bodyText, '\nci: ignore-semver')
20+
&& 'ignore' || 'check' }}
1621
1722
defaults:
1823
run:

ci/run-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ run() {
4343
--user "$(id -u)":"$(id -g)" \
4444
--env LIBC_CI \
4545
--env LIBC_CI_ZBUILD_STD \
46+
--env SEMVER_CHECKS \
4647
--env RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS \
4748
--env RUST_LIBC_UNSTABLE_GNU_TIME_BITS \
4849
--env CARGO_HOME=/cargo \

ci/verify-build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ test_target() {
113113
# FIXME(semver): can't pass `--target` to `cargo-semver-checks`
114114
if [ "$rust" = "stable" ] && [ "$target" = "$host_target" ]; then
115115
# Run semver checks on the stable channel
116-
cargo semver-checks --only-explicit-features \
117-
--features std,extra_traits
116+
cmd="cargo semver-checks --only-explicit-features --features std,extra_traits"
117+
118+
if [ "$SEMVER_CHECKS" = "ignore" ]; then
119+
$cmd || true
120+
else
121+
$cmd
122+
fi
118123
fi
119124
}
120125

0 commit comments

Comments
 (0)