summaryrefslogtreecommitdiff
path: root/.github/workflows/clippy.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/clippy.yaml')
-rw-r--r--.github/workflows/clippy.yaml40
1 files changed, 15 insertions, 25 deletions
diff --git a/.github/workflows/clippy.yaml b/.github/workflows/clippy.yaml
index 2d3ea70..c94f6ce 100644
--- a/.github/workflows/clippy.yaml
+++ b/.github/workflows/clippy.yaml
@@ -3,15 +3,17 @@ name: Clippy
on:
push:
paths:
- - 'Cargo.toml'
- - 'Cargo.lock'
- '**.rs'
+ - '.github/workflows/clippy.yaml'
+ - 'Cargo.lock'
+ - 'Cargo.toml'
branches: [main]
pull_request:
paths:
- - 'Cargo.toml'
- - 'Cargo.lock'
- '**.rs'
+ - '.github/workflows/clippy.yaml'
+ - 'Cargo.lock'
+ - 'Cargo.toml'
workflow_dispatch:
jobs:
@@ -27,33 +29,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- - name: Install Rust
- uses: dtolnay/rust-toolchain@stable
- with:
- components: "clippy"
-
- - name: Setup Rust cache
- uses: Swatinem/rust-cache@v2
+ - name: Install Nix
+ uses: DeterminateSystems/nix-installer-action@v13
- - name: Install SARIF tools
- run: |
- cargo install clippy-sarif sarif-fmt
-
- - name: Fetch Cargo deps
- run: |
- cargo fetch --locked
+ - name: Setup Nix cache
+ uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Run Clippy
- continue-on-error: true
+ id: clippy-run
run: |
- cargo clippy \
- --all-features \
- --all-targets \
- --message-format=json \
- | clippy-sarif | tee /tmp/clippy.sarif | sarif-fmt
+ nix build --print-build-logs .#checks.x86_64-linux.clippy-sarif
+ [ -L result ] || exit 1
+ echo "sarif-file=$(readlink -f result)" >> "$GITHUB_OUTPUT"
- name: Upload results
uses: github/codeql-action/upload-sarif@v3
with:
- sarif_file: /tmp/clippy.sarif
+ sarif_file: ${{ steps.clippy-run.outputs.sarif-file }}
wait-for-processing: true