Skip to content

Commit 3a2f3e0

Browse files
nickelcseanmonstar
authored andcommitted
chore: Use Cargo metadata for the MSRV build job
1 parent dd4c15c commit 3a2f3e0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818
- stable
1919
- beta
2020
- nightly
21-
# When updating this value, don't forget to also adjust the
22-
# `rust-version` field in the `Cargo.toml` file.
23-
- 1.49.0
2421

2522
include:
2623
- rust: nightly
@@ -51,10 +48,16 @@ jobs:
5148
- name: Checkout
5249
uses: actions/checkout@v3
5350

54-
- name: Install Rust
51+
- name: Get MSRV from package metadata
52+
id: metadata
53+
run: |
54+
cargo metadata --no-deps --format-version 1 |
55+
jq -r '"msrv=" + (.packages[] | select(.name == "http")).rust_version' >> $GITHUB_OUTPUT
56+
57+
- name: Install Rust (${{ steps.metadata.outputs.msrv }})
5558
uses: dtolnay/rust-toolchain@master
5659
with:
57-
toolchain: "1.49"
60+
toolchain: ${{ steps.metadata.outputs.msrv }}
5861

5962
- name: Test
6063
run: cargo test -p http

0 commit comments

Comments
 (0)