2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-18 15:26:16 +00:00

Merge pull request #2503 from nickelc/msrv

Set `rust-version` in Cargo metadata and use it in the MSRV build job
This commit is contained in:
David Peter 2023-03-15 08:36:17 +01:00 committed by GitHub
commit 12f2b7281b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,6 @@
name: CICD name: CICD
env: env:
MIN_SUPPORTED_RUST_VERSION: "1.62.0"
CICD_INTERMEDIATES_DIR: "_cicd-intermediates" CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
on: on:
@ -42,10 +41,13 @@ jobs:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }}) - name: Get the MSRV from the package metadata
id: msrv
run: cargo metadata --no-deps --format-version 1 | jq -r '"version=" + (.packages[] | select(.name = "bat").rust_version)' >> $GITHUB_OUTPUT
- name: Install rust toolchain (v${{ steps.msrv.outputs.version }})
uses: dtolnay/rust-toolchain@master uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }} toolchain: ${{ steps.msrv.outputs.version }}
components: clippy components: clippy
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix) - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
run: cargo clippy --locked --all-targets ${{ env.MSRV_FEATURES }} run: cargo clippy --locked --all-targets ${{ env.MSRV_FEATURES }}

View File

@ -10,6 +10,7 @@ version = "0.22.1"
exclude = ["assets/syntaxes/*", "assets/themes/*"] exclude = ["assets/syntaxes/*", "assets/themes/*"]
build = "build.rs" build = "build.rs"
edition = '2018' edition = '2018'
rust-version = "1.62"
[features] [features]
default = ["application"] default = ["application"]