Skip to content

Commit efb92f7

Browse files
ci: Change MSRV job to read MSRV from cargo
Delete msrv_toolchain.toml, and instead read the MSRV from cargo and copy it to rust-toolchain.toml. This ensures the job is checking the same MSRV set in Cargo.toml, and reduces the number of places that the MSRV needs to be manually updated when we change it.
1 parent 5602b1b commit efb92f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/msrv_toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ jobs:
120120
- name: Checkout sources
121121
uses: actions/checkout@v4
122122
- name: Set toolchain
123-
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
123+
run: |
124+
# Extract the MSRV using cargo.
125+
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi") | .rust_version')
126+
echo "MSRV: ${msrv}"
127+
# Set the MSRV in the toolchain config.
128+
sed -i "s:stable:${msrv}:" rust-toolchain.toml
124129
- uses: Swatinem/rust-cache@v2
125130
- name: Build
126131
# Build uefi-test-runner since its dependency tree includes all the

0 commit comments

Comments
 (0)