Skip to content

Commit 2c86502

Browse files
CI: add job to run tests under minimum supported rust version (msrv) (#11737)
## Summary This change adds a GitHub Actions CI job to check that the project builds and test pass under the declared minimum supported rust compiler. I have bumped the msrv to 1.74 as that is the lowest version I could get this project to build on. ## Test Plan The CI job has run on this PR, and will also run on the main branch.
1 parent 2567e14 commit 2c86502

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,38 @@ jobs:
212212
- name: "Build"
213213
run: cargo build --release --locked
214214

215+
cargo-build-msrv:
216+
name: "cargo build (msrv)"
217+
runs-on: ubuntu-latest
218+
needs: determine_changes
219+
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
220+
timeout-minutes: 20
221+
steps:
222+
- uses: actions/checkout@v4
223+
- uses: SebRollen/[email protected]
224+
id: msrv
225+
with:
226+
file: "Cargo.toml"
227+
field: "workspace.package.rust-version"
228+
- name: "Install Rust toolchain"
229+
run: rustup default ${{ steps.msrv.outputs.value }}
230+
- name: "Install mold"
231+
uses: rui314/setup-mold@v1
232+
- name: "Install cargo nextest"
233+
uses: taiki-e/install-action@v2
234+
with:
235+
tool: cargo-nextest
236+
- name: "Install cargo insta"
237+
uses: taiki-e/install-action@v2
238+
with:
239+
tool: cargo-insta
240+
- uses: Swatinem/rust-cache@v2
241+
- name: "Run tests"
242+
shell: bash
243+
env:
244+
NEXTEST_PROFILE: "ci"
245+
run: cargo +${{ steps.msrv.outputs.value }} insta test --all-features --unreferenced reject --test-runner nextest
246+
215247
cargo-fuzz:
216248
name: "cargo fuzz"
217249
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[workspace.package]
66
edition = "2021"
7-
rust-version = "1.71"
7+
rust-version = "1.74"
88
homepage = "https://docs.astral.sh/ruff"
99
documentation = "https://docs.astral.sh/ruff"
1010
repository = "https://github.com/astral-sh/ruff"

0 commit comments

Comments
 (0)