Skip to content

Commit 12e7fac

Browse files
authored
[CI] Use cargo-semver-checks to check compat in CI (#351)
We run the checks in the matrix so that we can run once for each target platform, although we don't yet actually make use of the target, so we're just running the same job repeatedly for the native target (ie, x86_64). I'm not yet sure how to run for different targets or whether it's even supported (I've filed [1] to ask). [1] obi1kenobi/cargo-semver-checks-action#54
1 parent a494e2b commit 12e7fac

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,28 @@ jobs:
241241
# `alloc` feature.
242242
if: matrix.features != '' && matrix.features != '--no-default-features'
243243

244+
# Check semver compatibility with the most recently-published version on
245+
# crates.io. We do this in the matrix rather than in its own job so that it
246+
# gets run on different targets. Some of our API is target-specific (e.g.,
247+
# SIMD type impls), and so we need to run on each target.
248+
#
249+
# TODO(https://github.com/obi1kenobi/cargo-semver-checks-action/issues/54):
250+
# Currently we don't actually do anything with `matrix.target`, so we're
251+
# just duplicating work by running this job multiple times, each time
252+
# targetting the host platform.
253+
- name: Check semver compatibility
254+
uses: obi1kenobi/cargo-semver-checks-action@v2
255+
with:
256+
# Don't semver check zerocopy-derive; as a proc macro, it doesn't have
257+
# an API that cargo-semver-checks can understand.
258+
package: zerocopy
259+
feature-group: all-features
260+
# TODO: Set this to the specific nightly we have pinned in CI. Not a big
261+
# deal since this isn't affected by the trybuild stderr files, which is
262+
# the reason we need to pin to a specific nightly.
263+
rust-toolchain: nightly
264+
if: matrix.crate == 'zerocopy' && matrix.features == '--all-features' && matrix.toolchain == 'nightly'
265+
244266
check_fmt:
245267
runs-on: ubuntu-latest
246268
name: Check Rust formatting

0 commit comments

Comments
 (0)