Skip to content

Commit

Permalink
ci: run rust-clippy, send results to CodeQL
Browse files Browse the repository at this point in the history
This adds a new analysis job to run Rust's code quality analyzer,
`rust-clippy`, and upload the JSON results to GitHub's CodeQL service.
This template was suggested by GitHub itself and I've modified it to fit
our repository; let's see how this goes.
  • Loading branch information
abrown committed Sep 26, 2024
1 parent 48e75eb commit 315975b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,34 @@ jobs:
uses: github/codeql-action/analyze@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
with:
category: "/language:${{matrix.language}}"

analyze_rust:
name: Analyze (Rust)
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install dependencies
run: |
rustup component add clippy
cargo install clippy-sarif sarif-fmt
- name: Run clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

0 comments on commit 315975b

Please sign in to comment.