Skip to content

Commit 8346d35

Browse files
authored
ci: add initial code scan configuration (#139)
This will integrate `clippy` with GitHub's code scanning feature.
1 parent f0700dc commit 8346d35

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/scan.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Scan the code in this repository; publish results to
2+
# https://github.com/intel/openvino-rs/security/code-scanning.
3+
4+
name: Code Scan
5+
6+
on:
7+
push:
8+
branches: ["main"]
9+
pull_request:
10+
branches: ["main"]
11+
schedule:
12+
- cron: "3 2 * * 1"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
analyze:
19+
name: Analyze (Rust)
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
security-events: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
28+
- name: Install clippy
29+
run: rustup component add clippy
30+
31+
- name: Install cargo-binstall
32+
uses: cargo-bins/cargo-binstall@3a99ae3c155195e5518c9ff954bee1b90f98b82c # v1.10.6
33+
34+
- name: Install dependencies
35+
run: cargo binstall --no-confirm clippy-sarif sarif-fmt
36+
37+
- name: Run clippy
38+
run: |
39+
cargo clippy --features openvino-sys/runtime-linking --message-format=json > clippy.json
40+
clippy-sarif --input clippy.json --output clippy.sarif
41+
sarif-fmt --input clippy.sarif
42+
continue-on-error: true
43+
44+
- name: Upload analysis
45+
uses: github/codeql-action/upload-sarif@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # v2.19.0
46+
with:
47+
sarif_file: clippy.sarif
48+
wait-for-processing: true

0 commit comments

Comments
 (0)