-
Notifications
You must be signed in to change notification settings - Fork 62
125 lines (124 loc) · 4.71 KB
/
benchmark.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Run Benchmark
on:
pull_request:
branches:
- 'master'
- 'develop'
jobs:
RunBenchmarkMainnet:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install solc-select
run: python -m pip install solc-select
- name: Install Slither
run: python -m pip install slither-analyzer
- name: Install Setuptools
run: python -m pip install setuptools
- name: Install Slitherin
run: python setup.py develop
- name: Configure
run: |
cd slitherin-benchmark/
ls
mv example.config.py config.py
- name: Install node dependencies
run: npm ci
- name: Install benchmark requirements
run: |
cd slitherin-benchmark/
python -m pip install -r requirements.txt
- name: Run Benchmark
run: |
cd slitherin-benchmark/
python runner.py -i contracts/mainnet -o mainnet.csv -eo mainnet_extra.csv --limit 8000 --skip-duplicates --skip-libs
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
python save_sheet.py -i mainnet.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln mainnet -pr $PR_NUMBER
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
PR_NUMBER: ${{ github.event.number }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: mainnet
path: slitherin-benchmark/mainnet.csv
- name: 'Upload Artifact Extra'
uses: actions/upload-artifact@v3
with:
name: mainnet
path: slitherin-benchmark/mainnet_extra.csv
RunBenchmarkOZ:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install solc-select
run: python -m pip install solc-select
- name: Install Slither
run: python -m pip install slither-analyzer
- name: Install Setuptools
run: python -m pip install setuptools
- name: Install Slitherin
run: python setup.py develop
- name: Configure
run: |
cd slitherin-benchmark/
mv example.config.py config.py
- name: Install node dependencies
run: npm ci
- name: Install benchmark requirements
run: |
cd slitherin-benchmark/
python -m pip install -r requirements.txt
- name: Run Benchmark
run: |
cd slitherin-benchmark/
python runner.py -i contracts/openzeppelin -o oz.csv -eo oz_extra.csv
- name: Upload sheet
run: |
cd slitherin-benchmark/
echo $GOOGLE_JWT > service_account.json
python save_sheet.py -i oz.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln OZ -pr $PR_NUMBER
env:
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}}
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }}
PR_NUMBER: ${{ github.event.number }}
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: oz
path: slitherin-benchmark/oz.csv
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: oz_extra
path: slitherin-benchmark/oz_extra.csv