-
Notifications
You must be signed in to change notification settings - Fork 23
50 lines (39 loc) · 1.23 KB
/
static_analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Cargo Clippy Workflow
on:
pull_request:
push:
branches: [master, develop]
env:
CARGO_TERM_COLOR: always
jobs:
static_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libclang-dev
- name: Install latest stable Rust
run: |
rustup update stable
rustup default stable
- name: Cache Cargo build
uses: Swatinem/rust-cache@v2
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
cache-provider: "actions"
- name: Install clippy-sarif and sarif-fmt
run: cargo install clippy-sarif sarif-fmt --locked
- name: Check code formatting
run: cargo fmt -- --check
- name: Run cargo clippy
env:
SKIP_WASM_BUILD: 1
run: |
cargo clippy --all-targets --all-features --message-format=json -- -D warnings | clippy-sarif | tee results.sarif | sarif-fmt
shell: bash
- name: Upload SARIF file
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif