Skip to content

Commit

Permalink
CI: Run clippy on stable and use msrv setting in clippy.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasmohrin authored and sharkdp committed Sep 3, 2021
1 parent f1a5aa0 commit a5f17db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.42.0"

0 comments on commit a5f17db

Please sign in to comment.