-
Notifications
You must be signed in to change notification settings - Fork 369
73 lines (62 loc) · 1.91 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: static-analysis
on:
push:
# Triggers the workflow on push to main
branches: [main]
paths:
- 'solidity/**'
- '.github/workflows/static-analysis.yml'
# Triggers the workflow on pull request
pull_request:
paths:
- 'solidity/**'
- '.github/workflows/static-analysis.yml'
jobs:
slither:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
- name: yarn-cache
uses: buildjet/cache@v4
with:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
- name: yarn-install
run: yarn install
- name: foundry-install
uses: foundry-rs/foundry-toolchain@v1
- name: forge-build
run: cd solidity && forge build --build-info
- name: Static analysis
uses: crytic/[email protected]
id: slither
with:
target: 'solidity/'
slither-config: 'solidity/slither.config.json'
sarif: results.sarif
fail-on: none
ignore-compile: true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slither.outputs.sarif }}
category: "slither"
- name: Olympix Integrated Security
uses: olympix/integrated-security@main
env:
OLYMPIX_API_TOKEN: ${{ secrets.OLYMPIX_API_TOKEN }}
OLYMPIX_CLI_LOG_LEVEL: 0
with:
args: -p ./solidity/contracts --output-format sarif --output-path ./
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: olympix.sarif
category: "olympix"