-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.23 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
name: ✅ Lint Code
on:
push:
branches: [ "main" ]
pull_request:
branches:
- main
schedule:
- cron: '19 4 * * 2'
jobs:
lint:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
# Checkout the repository
- name: 🛠️ Checkout code
uses: actions/checkout@v4
# Set up Rust toolchain
- name: 🦀 Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy, rustfmt
override: true
# Cache Rust dependencies
- name: 📦 Cache Rust dependencies
uses: Swatinem/rust-cache@v1
# Install clippy-sarif and sarif-fmt
- name: ⬇️ Install clippy-sarif and sarif-fmt
run: cargo install clippy-sarif sarif-fmt
# Run clippy and generate SARIF report
- name: 🔍 Run Clippy and generate SARIF
run: |
cargo clippy --all-targets --all-features --message-format=json |
clippy-sarif | tee results.sarif | sarif-fmt
# Upload SARIF file
- name: 📤 Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif