From 3a2f3e01c01e60b894d1f5b30554013d990010c6 Mon Sep 17 00:00:00 2001 From: Constantin Nickel Date: Wed, 12 Apr 2023 20:22:33 +0200 Subject: [PATCH] chore: Use Cargo metadata for the MSRV build job --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66aabb5d..603cefec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: - stable - beta - nightly - # When updating this value, don't forget to also adjust the - # `rust-version` field in the `Cargo.toml` file. - - 1.49.0 include: - rust: nightly @@ -51,10 +48,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install Rust + - name: Get MSRV from package metadata + id: metadata + run: | + cargo metadata --no-deps --format-version 1 | + jq -r '"msrv=" + (.packages[] | select(.name == "http")).rust_version' >> $GITHUB_OUTPUT + + - name: Install Rust (${{ steps.metadata.outputs.msrv }}) uses: dtolnay/rust-toolchain@master with: - toolchain: "1.49" + toolchain: ${{ steps.metadata.outputs.msrv }} - name: Test run: cargo test -p http