CI: Run clippy on stable and use msrv setting in `clippy.toml`

This commit is contained in:
Niklas Mohrin 2021-08-23 14:30:14 +02:00 committed by David Peter
parent f1a5aa0887
commit a5f17db53a
2 changed files with 21 additions and 6 deletions

View File

@ -14,17 +14,16 @@ on:
- '*'
jobs:
min_version:
name: Minimum supported rust version
code_quality:
name: Code quality
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
toolchain: stable
default: true
profile: minimal # minimal component installation (ie, no documentation)
components: clippy, rustfmt
@ -33,11 +32,26 @@ jobs:
with:
command: fmt
args: -- --check
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
- name: Ensure MSRV is set in `clippy.toml`
run: grep "^msrv = \"${{ env.MIN_SUPPORTED_RUST_VERSION }}\"\$" clippy.toml
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --locked --all-targets --all-features
min_version:
name: Minimum supported rust version
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
default: true
profile: minimal # minimal component installation (ie, no documentation)
- name: Run tests
uses: actions-rs/cargo@v1
with:

1
clippy.toml Normal file
View File

@ -0,0 +1 @@
msrv = "1.42.0"