f8050c2538 2026-01-02 1: # This workflow uses actions that are not certified by GitHub.
f8050c2538 2026-01-02 2: # They are provided by a third-party and are governed by
f8050c2538 2026-01-02 3: # separate terms of service, privacy policy, and support
f8050c2538 2026-01-02 4: # documentation.
f8050c2538 2026-01-02 5: # rust-clippy is a tool that runs a bunch of lints to catch common
f8050c2538 2026-01-02 6: # mistakes in your Rust code and help improve your Rust code.
f8050c2538 2026-01-02 7: # More details at https://github.com/rust-lang/rust-clippy
f8050c2538 2026-01-02 8: # and https://rust-lang.github.io/rust-clippy/
f8050c2538 2026-01-02 9:
10: name: rust-clippy analyze
11:
12: on:
13: push:
14: branches: [ "master" ]
15: pull_request:
16: # The branches below must be a subset of the branches above
17: branches: [ "master" ]
f8050c2538 2026-01-02 18: schedule:
f8050c2538 2026-01-02 19: - cron: '43 14 * * 2'
20:
21: jobs:
f8050c2538 2026-01-02 22: rust-clippy-analyze:
23: name: Run rust-clippy analyzing
24: runs-on: ubuntu-latest
25: permissions:
26: contents: read
27: security-events: write
f8050c2538 2026-01-02 28: actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29: steps:
30: - name: Checkout code
31: uses: actions/checkout@v6
32:
33: - name: Install Rust toolchain
f8050c2538 2026-01-02 34: uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
f8050c2538 2026-01-02 35: with:
f8050c2538 2026-01-02 36: profile: minimal
f8050c2538 2026-01-02 37: toolchain: stable
f8050c2538 2026-01-02 38: components: clippy
f8050c2538 2026-01-02 39: override: true
f8050c2538 2026-01-02 40:
f8050c2538 2026-01-02 41: - name: Install required cargo
f8050c2538 2026-01-02 42: run: cargo install clippy-sarif sarif-fmt
43:
44: - name: Run rust-clippy
f8050c2538 2026-01-02 45: run:
f8050c2538 2026-01-02 46: cargo clippy
f8050c2538 2026-01-02 47: --all-features
f8050c2538 2026-01-02 48: --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
f8050c2538 2026-01-02 49: continue-on-error: true
f8050c2538 2026-01-02 50:
f8050c2538 2026-01-02 51: - name: Upload analysis results to GitHub
f8050c2538 2026-01-02 52: uses: github/codeql-action/upload-sarif@v4
f8050c2538 2026-01-02 53: with:
f8050c2538 2026-01-02 54: sarif_file: rust-clippy-results.sarif
f8050c2538 2026-01-02 55: wait-for-processing: true