Skip to content

Commit 481c31d

Browse files
nickelcseanmonstar
authored andcommitted
chore: Use Cargo metadata for the MSRV build job
1 parent d3d50ef commit 481c31d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/CI.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,24 @@ jobs:
6666
if: matrix.rust == 'nightly'
6767

6868
msrv:
69-
name: Check MSRV (${{ matrix.rust }})
69+
name: Check MSRV
7070
needs: [style]
71-
strategy:
72-
matrix:
73-
rust:
74-
- 1.56 # never go past Hyper's own MSRV
75-
76-
os:
77-
- ubuntu-latest
7871

79-
runs-on: ${{ matrix.os }}
72+
runs-on: ubuntu-latest
8073

8174
steps:
8275
- name: Checkout
8376
uses: actions/checkout@v3
8477

85-
- name: Install Rust (${{ matrix.rust }})
78+
- name: Get MSRV from package metadata
79+
id: metadata
80+
run: |
81+
cargo metadata --no-deps --format-version 1 |
82+
jq -r '"msrv=" + (.packages[] | select(.name == "h2")).rust_version' >> $GITHUB_OUTPUT
83+
84+
- name: Install Rust (${{ steps.metadata.outputs.msrv }})
8685
uses: dtolnay/rust-toolchain@master
8786
with:
88-
toolchain: ${{ matrix.rust }}
87+
toolchain: ${{ steps.metadata.outputs.msrv }}
8988

9089
- run: cargo check

0 commit comments

Comments
 (0)