From 9c4dbded013c3f103a15165c1880e7fe1e3bd41a Mon Sep 17 00:00:00 2001 From: Constantin Nickel Date: Mon, 27 Mar 2023 10:49:27 +0200 Subject: [PATCH] Set 'rust-version` in Cargo metadata and use it in the MSRV build job --- .github/workflows/ci.yml | 14 +++++++------- Cargo.toml | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a2a810c7..4c52bac65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,23 +248,23 @@ jobs: cargo check --all-features msrv: - name: MSRV ${{ matrix.rust }} + name: MSRV needs: [style] runs-on: ubuntu-latest - strategy: - matrix: - rust: [1.57.0] - steps: - name: Checkout uses: actions/checkout@v3 - - name: Install rust + - name: Get MSRV package metadata + id: metadata + run: cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' >> $GITHUB_OUTPUT + + - name: Install rust (${{ steps.metadata.outputs.msrv }}) uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: ${{ steps.metadata.outputs.msrv }} - name: Check run: cargo check diff --git a/Cargo.toml b/Cargo.toml index 69f5a3107..c2d674fab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ authors = ["Sean McArthur "] readme = "README.md" license = "MIT OR Apache-2.0" edition = "2018" +rust-version = "1.57.0" autotests = true [package.metadata.docs.rs]