-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.3 KB
/
lint.yaml
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
51
52
53
54
55
56
57
58
59
---
name: "Check formatting and linting"
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
env:
CARGO_TERM_COLOR: "always"
jobs:
format-and-lint:
name: "Check formatting and linting"
runs-on: ["ubuntu-latest"]
steps:
- id: "checkout"
name: "Checkout repository"
uses: "actions/checkout@v4"
with:
filter: "tree:0"
- id: "setup-toolchain"
name: "Install Rust toolchain"
uses: "dtolnay/rust-toolchain@master"
with:
toolchain: "stable"
- id: "setup-cache"
name: "Cache dependencies"
uses: "Swatinem/rust-cache@v2"
- id: "setup-sarif"
name: "Setup SARIF tools"
run: |
cargo install clippy-sarif sarif-fmt
- id: "fmt"
name: "Check formatting"
run: |
cargo fmt --all -- --check
- id: "run-clippy"
name: "Run Clippy"
run: >
cargo clippy --all-targets --all-features --message-format=json -- -D warnings
| clippy-sarif
| tee results.sarif
| sarif-fmt
- id: "upload-sarif"
name: "Upload SARIF file"
uses: "github/codeql-action/upload-sarif@v3"
with:
sarif_file: "results.sarif"
category: "rust-clippy"