Skip to content

Commit

Permalink
Don't use reviewdog
Browse files Browse the repository at this point in the history
Instead run Clippy as a separate job. Note that failures are ignore for
nightly builds.
  • Loading branch information
fredizzimo committed Jul 6, 2024
1 parent 24fcfc9 commit 98ce837
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

- name: Show toolchain info
run: cargo --version --verbose
Expand Down Expand Up @@ -93,24 +92,40 @@ jobs:
path: |
test-results-${{ matrix.os }}-${{ matrix.toolchain }}
clippy:
needs: lint
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-12, ubuntu-latest]
toolchain: [stable, nightly]
runs-on: ${{ matrix.os }}

- name: Install Sarif
run: cargo binstall -y clippy-sarif sarif-fmt
steps:
- uses: actions/checkout@v4

- name: Setup Reviewdog
uses: reviewdog/action-setup@v1
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
reviewdog_version: latest
toolchain: ${{ matrix.toolchain }}
components: clippy

- name: Run Clippy
run: cargo clippy --all-targets --message-format=json | clippy-sarif | tee clippy.sarif | sarif-fmt
continue-on-error: true
- name: Show toolchain info
run: cargo --version --verbose

- name: Run Clippy Reviewdog
run: cat clippy.sarif | reviewdog -f=sarif -name=clippy -reporter=github-check -filter-mode=file -fail-on-error=true -level=warning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings
continue-on-error: ${{ toolchain == 'nightly' }}

event-upload:
needs: test
Expand All @@ -123,7 +138,7 @@ jobs:
path: ${{ github.event_path }}

build-deploy:
needs: test
needs: [test, clippy]
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 98ce837

Please sign in to comment.