Skip to content

Commit d4fd7cc

Browse files
authored
Add CI job checking library builds with oldest allowed dependencies (#854)
* Add CI job checking library builds with oldest allowed dependencies Prevents under-specifying our dependencies. Ensure the semver specs we write in our Cargo.toml are not allowing older versions than we actually build with * Run minimal-versions CI against MSRV and move to variable
1 parent 43bf90a commit d4fd7cc

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
name: tests
1111
env:
1212
CARGO_TERM_COLOR: always
13+
MSRV: 1.80.0
1314

1415
jobs:
1516
ci:
@@ -19,7 +20,7 @@ jobs:
1920
matrix:
2021
rust:
2122
- 1.87.0 # Stable release as of 2025-05-17
22-
- 1.80.0 # MSRV
23+
- $MSRV # MSRV
2324

2425
steps:
2526
- uses: actions/checkout@v4
@@ -98,3 +99,23 @@ jobs:
9899

99100
- name: check typos
100101
uses: crate-ci/[email protected]
102+
103+
104+
# Make sure the library builds with all dependencies downgraded to their
105+
# oldest versions allowed by the semver spec. This ensures we have not
106+
# under-specified any dependency
107+
minimal-versions:
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- name: Install needed Rust toolchain versions
113+
run: |
114+
rustup install $MSRV
115+
rustup install nightly
116+
117+
- name: Downgrade dependencies to minimal versions
118+
run: cargo +nightly update -Z minimal-versions
119+
120+
- name: Compile with minimal versions
121+
run: cargo +$MSRV build --all-targets --locked

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ name = "criterion"
99
# * Update version numbers in the book;
1010
version = "0.6.0"
1111
edition = "2021"
12+
# Update the MSRV variable in .github/workflows/ci.yml when changing this.
1213
rust-version = "1.80"
1314

1415
description = "Statistics-driven micro-benchmarking library"

0 commit comments

Comments
 (0)