diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88bb2a9c4..c08f1c60f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,19 +155,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - name: Setup Nightly Rust toolchain - uses: ./.github/actions/setup-builder - name: Install protoc uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Generate minimal versions lockfile - run: | - cargo generate-lockfile -Z direct-minimal-versions - name: Setup MSRV Rust toolchain uses: ./.github/actions/setup-builder with: rust-version: ${{ env.rust_msrv }} + - name: Setup Nightly Rust toolchain + uses: ./.github/actions/setup-builder - name: Check MSRV - run: | - cargo +${{ env.rust_msrv }} check --locked --workspace + run: make check-msrv diff --git a/Makefile b/Makefile index 2cc847d7b..1b98fe8fa 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,15 @@ fix-toml: install-taplo-cli check-toml: install-taplo-cli taplo check +NIGHTLY_VERSION := $(shell awk -F'"' '/^channel/ {print $$2}' rust-toolchain.toml) +MSRV_VERSION := $(shell awk -F'"' '/^rust-version/ {print $$2}' Cargo.toml) + +check-msrv: + @set -e; \ + trap 'git restore Cargo.lock' EXIT; \ + cargo +$(NIGHTLY_VERSION) generate-lockfile -Z direct-minimal-versions; \ + cargo +$(MSRV_VERSION) check --locked --workspace + check: check-fmt check-clippy check-toml cargo-machete doc-test: