forked from trailofbits/manticore
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (167 loc) · 5.03 KB
/
ci.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
jobs:
# needs to run only on pull_request
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Lint
if: github.event_name == 'pull_request'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
pip install -e .[lint]
black --version
git fetch --depth=1 origin $BASE_SHA
echo "Files Changed:"
git diff --name-only $BASE_SHA... | tee .diff_names.txt
NAMES=$(cat .diff_names.txt | python scripts/pyfile_exists.py)
if test -z $NAMES
then
black --diff --check .
else
echo $NAMES | xargs black --diff --check
fi
mypy --version
mypy
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
type: ["ethereum_truffle", "ethereum_bench", "examples", "ethereum", "ethereum_vm", "native", "wasm", "wasm_sym", "other"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install NPM
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
env:
TEST_TYPE: ${{ matrix.type }}
run: |
#install utils
pip install coveralls
pip install -e ".[dev-noks]"
# Get version info
pip freeze
z3 --version
#install cvc4
sudo wget -O /usr/bin/cvc4 https://github.com/CVC4/CVC4/releases/download/1.7/cvc4-1.7-x86_64-linux-opt
sudo chmod +x /usr/bin/cvc4
cvc4 --version
#install yices
sudo wget -O yices.tar.gz https://yices.csl.sri.com/releases/2.6.2/yices-2.6.2-x86_64-pc-linux-gnu-static-gmp.tar.gz
sudo tar -xzf yices.tar.gz
cd yices-2.6.2
sudo ./install-yices
yices --version
#install boolector
mkdir -p /tmp/build
cd /tmp/build
git clone https://github.com/boolector/boolector.git
cd boolector
# Version 3.2.1
git checkout "f61c0dcf4a76e2f7766a6358bfb9c16ca8217224"
git log -1 --oneline > ../boolector.commit
./contrib/setup-lingeling.sh
./contrib/setup-btor2tools.sh
./configure.sh
cd build
make -j4
mkdir -p /tmp/boolector
sudo make DESTDIR=/usr install
# Install solc unconditionally because it only takes a second or two
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Run Tests
env:
TEST_TYPE: ${{ matrix.type }}
run: |
cp scripts/run_tests.sh .
./run_tests.sh
- name: Coveralls Parallel
shell: bash
run: |
set +e
counter=1
while [ "${counter}" -le 10 ] ; do
echo "Attempt ${counter} to upload"
$(coveralls --service=github)
if [ $? -eq 0 ] ; then
exit 0
fi
((counter++))
sleep 1
done
exit 1
env:
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
manticore-server:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: 'Install tools'
run: |
# just command runner https://github.com/casey/just#pre-built-binaries
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "${HOME}/.local/bin"
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: 'Lint MUI Server'
working-directory: server
run: |
just init
source venv/bin/activate
just lint
- name: 'Test MUI Server'
working-directory: server
run: |
source venv/bin/activate
just test
# Send notification when all tests have finished to combine coverage results
coverage-finish:
needs: tests
runs-on: ubuntu-20.04
steps:
- name: Coveralls Finished
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
upload:
runs-on: ubuntu-20.04
if: github.event_name == 'schedule'
needs: tests
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build Dist
run: |
python3 -m pip install wheel
python3 setup.py --dev_release sdist bdist_wheel
- name: Upload to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_UPLOAD }}