Skip to content

Commit 9baa95f

Browse files
authored
ci: add slither static analyzer (#225)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. --> ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords
1 parent 2fd81c6 commit 9baa95f

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/code-analysis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Slither Analysis
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
security-events: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install Foundry
21+
uses: onbjerg/foundry-toolchain@v1
22+
with:
23+
version: nightly
24+
25+
- name: Build project
26+
working-directory: ./
27+
run: forge build --build-info --skip test script
28+
29+
- name: Run Slither
30+
uses: crytic/slither-action@v0.3.0
31+
id: slither
32+
with:
33+
ignore-compile: true
34+
node-version: 16
35+
sarif: results.sarif
36+
fail-on: none
37+
38+
- name: Upload SARIF file
39+
uses: github/codeql-action/upload-sarif@v2
40+
with:
41+
sarif_file: ${{ steps.slither.outputs.sarif }}

slither.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"filter_paths": "(lib/)"
3+
}

0 commit comments

Comments
 (0)