-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use latest version of clippy action to get strict mode
- Loading branch information
Showing
1 changed file
with
5 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ jobs: | |
# make this command fail if cargo fmt had to make changes | ||
run: cargo fmt && git diff-index --exit-code HEAD | ||
|
||
# Linting job permissive (cargo-clippy) - completes and puts warnings inline in PR | ||
# Linting job (cargo-clippy) - completes and puts warnings inline in PR | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
@@ -72,7 +72,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Linting job permissive > Cache steps | ||
# Linting job > Cache steps | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
|
@@ -92,32 +92,12 @@ jobs: | |
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
# Linting job permissive > Install and run clippy steps | ||
# Linting job > Install and run clippy steps | ||
|
||
- name: Install clippy | ||
run: rustup component add clippy | ||
|
||
# Run clippy first time to get warnings inserted inline in PR | ||
- uses: actions-rs/clippy-check@v1 | ||
- uses: actions-rs/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-targets --all-features | ||
|
||
# Linting job strict (cargo-clippy) | ||
|
||
lint_strict: | ||
runs-on: ubuntu-latest | ||
|
||
needs: [build] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Linting job strict > Install and run clippy steps | ||
|
||
- name: Install clippy | ||
run: rustup component add clippy | ||
|
||
# avoid caching to prevent confusing cargo clippy | ||
- name: Fail clippy on warnings | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
args: --all-targets --all-features -- -D warnings |