build(clippy): 👷 add clippy CodeQL analysis #3
Workflow file for this run
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
name: rust-clippy analysis | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '20 2 * * 0' | |
jobs: | |
rust-clippy-analyze: | |
name: Run rust-clippy analysis | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@v4 | |
- name: Set up cargo cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: clippy | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Add .cargo/bin to PATH | |
run: | | |
echo "PATH=${HOME}/.cargo/bin:${PATH}" | tee -a "$GITHUB_ENV" | |
- name: Install required cargo | |
run: 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 results to GitHub | |
uses: github/codeql-action/upload-sarif@v1 | |
with: | |
sarif_file: rust-clippy-results.sarif | |
wait-for-processing: true |