Skip to content

Commit 549c383

Browse files
authored
infra: add check-msrv to Makefile (#1680)
## Which issue does this PR close? - Closes #1667. ## What changes are included in this PR? Add `make check-msrv` command to run the same MSRV check in CI and locally ## Are these changes tested? I verified by upgrading datafusion from 48 to 49 locally and continuously run `make check-msrv`
1 parent 2715d52 commit 549c383

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,15 @@ jobs:
169169
runs-on: ubuntu-latest
170170
steps:
171171
- uses: actions/checkout@v5
172-
- name: Setup Nightly Rust toolchain
173-
uses: ./.github/actions/setup-builder
174172
- name: Install protoc
175173
uses: arduino/setup-protoc@v3
176174
with:
177175
repo-token: ${{ secrets.GITHUB_TOKEN }}
178-
- name: Generate minimal versions lockfile
179-
run: |
180-
cargo generate-lockfile -Z direct-minimal-versions
181176
- name: Setup MSRV Rust toolchain
182177
uses: ./.github/actions/setup-builder
183178
with:
184179
rust-version: ${{ env.rust_msrv }}
180+
- name: Setup Nightly Rust toolchain
181+
uses: ./.github/actions/setup-builder
185182
- name: Check MSRV
186-
run: |
187-
cargo +${{ env.rust_msrv }} check --locked --workspace
183+
run: make check-msrv

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ fix-toml: install-taplo-cli
4141
check-toml: install-taplo-cli
4242
taplo check
4343

44+
NIGHTLY_VERSION := $(shell awk -F'"' '/^channel/ {print $$2}' rust-toolchain.toml)
45+
MSRV_VERSION := $(shell awk -F'"' '/^rust-version/ {print $$2}' Cargo.toml)
46+
47+
check-msrv:
48+
@set -e; \
49+
trap 'git restore Cargo.lock' EXIT; \
50+
cargo +$(NIGHTLY_VERSION) generate-lockfile -Z direct-minimal-versions; \
51+
cargo +$(MSRV_VERSION) check --locked --workspace
52+
4453
check: check-fmt check-clippy check-toml cargo-machete
4554

4655
doc-test:

0 commit comments

Comments
 (0)