Skip to content

Commit

Permalink
Set 'rust-version` in Cargo metadata and use it in the MSRV build job (
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelc authored Mar 27, 2023
1 parent 7fdd014 commit cc47ef1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = ["Sean McArthur <[email protected]>"]
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2018"
rust-version = "1.57.0"
autotests = true

[package.metadata.docs.rs]
Expand Down

0 comments on commit cc47ef1

Please sign in to comment.