Skip to content

Commit 9d0c809

Browse files
authored
Merge pull request #2003 from EliahKagan/run-ci/msrv-check
Improve MSRV check and fix `aria-label` in MSRV badge
2 parents ac5f33d + 3a63c68 commit 9d0c809

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ jobs:
433433

434434
defaults:
435435
run:
436-
shell: bash # Use bash even on Windows, if we ever reenable windows-latest for testing.
436+
# Use `bash` even on Windows, if we ever reenable `windows-latest` for testing.
437+
shell: bash
437438

438439
steps:
439440
- uses: actions/checkout@v4

.github/workflows/msrv.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,21 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030

3131
env:
32-
# dictated by `firefox` to support the `helix` editor, but now probably effectively be controlled by `jiff`, which also aligns with `regex`.
33-
# IMPORTANT: adjust etc/msrv-badge.svg as well
34-
rust_version: 1.75.0
32+
# This is dictated by `firefox` to support the `helix` editor, but now probably effectively
33+
# be controlled by `jiff`, which also aligns with `regex`.
34+
# IMPORTANT: When adjusting, change all occurrences in `etc/msrv-badge.svg` as well.
35+
RUST_VERSION: 1.75.0
3536

3637
steps:
3738
- uses: actions/checkout@v4
3839
- uses: extractions/setup-just@v3
39-
- run: |
40-
rustup toolchain install ${{ env.rust_version }} nightly --profile minimal --no-self-update
41-
rustup default ${{ env.rust_version }}
40+
- name: Set up ${{ env.RUST_VERSION }} (MSRV) and nightly toolchains
41+
run: rustup toolchain install ${{ env.RUST_VERSION }} nightly --profile minimal --no-self-update
42+
- name: Set ${{ env.RUST_VERSION }} (MSRV) as default
43+
run: rustup default ${{ env.RUST_VERSION }}
44+
- name: Downgrade locked dependencies to lowest allowed versions
45+
run: |
46+
# TODO(msrv): Use `cargo update --minimal-versions` when `--minimal-versions` is available.
4247
cargo +nightly update -Zminimal-versions
43-
- run: just ci-check-msrv
48+
- name: Run some `cargo build` commands on `gix`
49+
run: just ci-check-msrv

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ bench-gix-config:
126126

127127
check-msrv-on-ci: ## Check the minimal support rust version for currently installed Rust version
128128
rustc --version
129-
cargo check --package gix
130-
cargo check --package gix --no-default-features --features async-network-client,max-performance
129+
cargo build --locked --package gix
130+
cargo build --locked --package gix --no-default-features --features async-network-client,max-performance
131131

132132
##@ Maintenance
133133

etc/msrv-badge.svg

+1-1
Loading

justfile

+8-3
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,16 @@ cross-test-android: (cross-test 'armv7-linux-androideabi' '--no-default-features
238238
check-size:
239239
etc/check-package-size.sh
240240

241-
# Check the minimal support Rust version, with the currently installed Rust version
241+
# This assumes the current default toolchain is the Minimal Supported Rust Version and checks
242+
# against it. This is run on CI in `msrv.yml`, after the MSRV toolchain is installed and set as
243+
# default, and after dependencies in `Cargo.lock` are downgraded to the latest MSRV-compatible
244+
# versions. Only if those or similar steps are done first does this work to validate the MSRV.
245+
#
246+
# Check the MSRV, *if* the toolchain is set and `Cargo.lock` is downgraded (used on CI)
242247
ci-check-msrv:
243248
rustc --version
244-
cargo check -p gix
245-
cargo check -p gix --no-default-features --features async-network-client,max-performance
249+
cargo build --locked -p gix
250+
cargo build --locked -p gix --no-default-features --features async-network-client,max-performance
246251

247252
# Enter a nix-shell able to build on macOS
248253
nix-shell-macos:

0 commit comments

Comments
 (0)