Skip to content

Commit

Permalink
ci: Use auguwu/clippy-action@1.4.0 to run clippy
Browse files Browse the repository at this point in the history
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338

HACK: Use my fork of auguwu/clippy-action to support "features" input.
  • Loading branch information
Techcable committed Sep 23, 2024
1 parent 6fa18aa commit 2db08f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ env:

jobs:
test:
permissions:
# Needed for auguwu/clippy-action
checks: write
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}

Expand Down Expand Up @@ -116,19 +119,9 @@ jobs:
continue-on-error: false

- name: Clippy
# With the exception of nightly, we use --deny warnings to treat warnings on errors.
run: |
cargo clippy --all-targets --verbose --features "${{ matrix.features }}" -- --deny "${{ matrix.rust != 'nightly' && 'warnings' || 'clippy::correctness' }}"
# Clippy is required to succeed on hardcoded versions, and may not give any warnings.
#
# However, on automatically updated versions of rust (both stable & nightly) we allow clippy to fail.
# This is in case automatic updates have introduced new lints that would give warnings/errors
# about code that was previously allowed.
#
# This is the main reason that we have a 'hardcoded recent stable' version.
# We want as many lints from recent stable possible
# but don't want the surprises of automatic updates to our stable rust.
#
# Also, include an explicit exception for Rust 1.56.
# We don't want to deal with the fact clippy changed the names of some lints.
continue-on-error: ${{ !contains(matrix.rust, '1.') || matrix.rust == '1.56' }}
# TODO: Use actual auguwu/clippy-action action instead of my fork
uses: Techcable/clippy-action@input/features
with:
check-args: --all-targets
features: "${{ matrix.features }}"
token: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

* ci: Make clippy warnings give CI warnings, not errors

### 2.8.0-beta.2 - 2024-01-05

* Add `ErrorRef` wrapper to enable logging error references (PR #327)
Expand Down

0 comments on commit 2db08f0

Please sign in to comment.