mirror of https://github.com/astral-sh/ruff
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.
This commit is contained in:
parent
2567e14b7a
commit
2c865023ac
|
|
@ -212,6 +212,38 @@ jobs:
|
||||||
- name: "Build"
|
- name: "Build"
|
||||||
run: cargo build --release --locked
|
run: cargo build --release --locked
|
||||||
|
|
||||||
|
cargo-build-msrv:
|
||||||
|
name: "cargo build (msrv)"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: determine_changes
|
||||||
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
||||||
|
timeout-minutes: 20
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: SebRollen/toml-action@v1.2.0
|
||||||
|
id: msrv
|
||||||
|
with:
|
||||||
|
file: "Cargo.toml"
|
||||||
|
field: "workspace.package.rust-version"
|
||||||
|
- name: "Install Rust toolchain"
|
||||||
|
run: rustup default ${{ steps.msrv.outputs.value }}
|
||||||
|
- name: "Install mold"
|
||||||
|
uses: rui314/setup-mold@v1
|
||||||
|
- name: "Install cargo nextest"
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cargo-nextest
|
||||||
|
- name: "Install cargo insta"
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cargo-insta
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: "Run tests"
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
NEXTEST_PROFILE: "ci"
|
||||||
|
run: cargo +${{ steps.msrv.outputs.value }} insta test --all-features --unreferenced reject --test-runner nextest
|
||||||
|
|
||||||
cargo-fuzz:
|
cargo-fuzz:
|
||||||
name: "cargo fuzz"
|
name: "cargo fuzz"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.71"
|
rust-version = "1.74"
|
||||||
homepage = "https://docs.astral.sh/ruff"
|
homepage = "https://docs.astral.sh/ruff"
|
||||||
documentation = "https://docs.astral.sh/ruff"
|
documentation = "https://docs.astral.sh/ruff"
|
||||||
repository = "https://github.com/astral-sh/ruff"
|
repository = "https://github.com/astral-sh/ruff"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue