-
Notifications
You must be signed in to change notification settings - Fork 14
413 lines (405 loc) · 15.3 KB
/
pull-request-checks.yaml
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
name: Build and Test HW-CBMC
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# This job takes approximately 15 minutes
check-ubuntu-20_04-make-gcc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
env:
# This is needed in addition to -yq to prevent apt-get from asking for
# user input
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq gcc gdb g++ jq flex bison libxml2-utils ccache cmake z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v4
with:
path: .ccache
save-always: true
key: ${{ runner.os }}-20.04-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-20.04-make-gcc-${{ github.ref }}
${{ runner.os }}-20.04-make-gcc
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Get cadical and minisat
run: |
make -C lib/cbmc/src cadical-download minisat2-download
- name: Build with make
run: make -C src -j4 CXX="ccache g++" MINISAT2=../../minisat-2.2.1 CADICAL=../../cadical
- name: Run unit tests
run: make -C unit -j4 CXX="ccache g++"
- name: Run the ebmc tests with SAT
run: make -C regression/ebmc test
- name: Run the ebmc tests with Z3
run: make -C regression/ebmc test-z3
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Run the verilog tests with Z3
run: make -C regression/verilog test-z3
- name: Run the smv tests
run: make -C regression/smv test
- name: Run the smv tests with Z3
run: make -C regression/smv test-z3
- name: Run the vlindex tests
run: make -C regression/vlindex test
- name: Print ccache stats
run: ccache -s
# This job takes approximately 15 minutes
check-ubuntu-20_04-make-clang:
runs-on: ubuntu-20.04
env:
CC: "ccache clang"
CXX: "ccache clang++"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
env:
# This is needed in addition to -yq to prevent apt-get from asking for
# user input
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq clang-10 clang++-10 gdb jq flex bison libxml2-utils cpanminus ccache z3
cpanm Thread::Pool::Simple
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v4
with:
path: .ccache
save-always: true
key: ${{ runner.os }}-20.04-make-clang-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-20.04-make-clang-${{ github.ref }}
${{ runner.os }}-20.04-make-clang
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Get minisat
run: |
make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make CXX="ccache clang++" -C src -j4
- name: Run unit tests
run: make -C unit -j4 CXX="ccache clang++"
- name: Run the ebmc tests with SAT
run: make -C regression/ebmc test
- name: Run the ebmc tests with Z3
run: make -C regression/ebmc test-z3
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Run the verilog tests with Z3
run: make -C regression/verilog test-z3
- name: Run the smv tests
run: make -C regression/smv test
- name: Run the smv tests with Z3
run: make -C regression/smv test-z3
- name: Run the vlindex tests
run: make -C regression/vlindex test
- name: Print ccache stats
run: ccache -s
- name: Upload the ebmc binary
uses: actions/upload-artifact@v4
with:
name: ebmc-binary
retention-days: 5
path: src/ebmc/ebmc
# This job takes approximately 4 minutes
benchmarking:
runs-on: ubuntu-20.04
needs: check-ubuntu-20_04-make-clang
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
env:
# This is needed in addition to -yq to prevent apt-get from asking for
# user input
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Get the ebmc binary
uses: actions/download-artifact@v4
with:
name: ebmc-binary
path: ebmc
- name: Try the ebmc binary
run: chmod a+x ./ebmc/ebmc ; ./ebmc/ebmc --version
- name: HWMCC08 benchmarks
run: PATH=$PATH:$PWD/ebmc benchmarking/hwmcc08.sh
# This job takes approximately 1 minute
examples:
runs-on: ubuntu-20.04
needs: check-ubuntu-20_04-make-clang
steps:
- uses: actions/checkout@v4
- name: Get the ebmc binary
uses: actions/download-artifact@v4
with:
name: ebmc-binary
path: ebmc
- name: Try the ebmc binary
run: chmod a+x ./ebmc/ebmc ; ./ebmc/ebmc --version
- name: Hazard3
run: PATH=$PATH:$PWD/ebmc examples/Hazard3/Hazard3.sh
# This job takes approximately 15 minutes
check-centos8-make-gcc:
name: CentOS 8
runs-on: ubuntu-22.04
container:
image: centos:8
steps:
- name: Install Packages
run: |
sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-Linux-*
yum -y install make gcc-c++ flex bison git rpmdevtools wget
wget --no-verbose https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
tar xJf ccache-4.8.3-linux-x86_64.tar.xz
cp ccache-4.8.3-linux-x86_64/ccache /usr/bin/
# yum install dnf-plugins-core
# yum config-manager --set-enabled powertools
# yum install glibc-static libstdc++-static
- name: cache for ccache
uses: actions/cache@v4
with:
path: /github/home/.cache/ccache
save-always: true
key: ${{ runner.os }}-centos8-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: ${{ runner.os }}-centos8-make-gcc-
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: ccache path
run: ccache -p | grep cache_dir
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs" -C src -j4
- name: Run unit tests
run: make -C unit -j4 CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs"
- name: Run the ebmc tests with SAT
run: |
rm regression/ebmc/neural-liveness/counter1.desc
make -C regression/ebmc test
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Run the smv tests
run: make -C regression/smv test
- name: Run the vlindex tests
run: make -C regression/vlindex test
- name: Print ccache stats
run: ccache -s
# This job takes approximately 20 minutes
check-macos-14-make-clang:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
run: brew install bison ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v4
with:
save-always: true
path: .ccache
key: ${{ runner.os }}-make-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-make-${{ github.ref }}
${{ runner.os }}-make
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make YACC="/opt/homebrew/opt/bison/bin/bison" CXX="ccache clang++" -C src -j3
- name: Run unit tests
run: make -C unit -j3 CXX="ccache g++"
- name: Run the ebmc tests with SAT
run: make -C regression/ebmc test
- name: Run the ebmc tests with Z3
run: make -C regression/ebmc test-z3
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Run the verilog tests with Z3
run: make -C regression/verilog test-z3
- name: Run the smv tests
run: make -C regression/smv test
- name: Run the smv tests with Z3
run: make -C regression/smv test-z3
- name: Run the vlindex tests
run: make -C regression/vlindex test
- name: Print ccache stats
run: ccache -s
# This job takes approximately 17 minutes
check-ubuntu-24_04-make-emcc:
name: Emscripten build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
env:
# This is needed in addition to -yq to prevent apt-get from asking for
# user input
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq emscripten flex bison libxml2-utils cpanminus ccache
- name: Install node.js 23
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install emscripten
run: |
# The emscripten package in Ubuntu is too far behind.
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout 3.1.31
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
emcc --version
- name: Prepare ccache
uses: actions/cache@v4
with:
path: .ccache
save-always: true
key: ${{ runner.os }}-24.04-make-emcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-24.04-make-emcc-${{ github.ref }}
${{ runner.os }}-24.04-make-emcc
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: |
source emsdk/emsdk_env.sh
make -C src -j4 \
BUILD_ENV=Unix \
CXX="ccache emcc -fwasm-exceptions" \
LINKFLAGS="-sEXPORTED_RUNTIME_METHODS=callMain -sALLOW_MEMORY_GROWTH=1" \
LINKLIB="emar rc \$@ \$^" \
AR="emar" \
EXEEXT=".html" \
HOSTCXX="ccache g++" \
HOSTLINKFLAGS=""
- name: print version number via node.js
run: node --experimental-wasm-exnref src/ebmc/ebmc.js --version
- name: Compile unit tests
run: |
source emsdk/emsdk_env.sh
make -C unit unit_tests.html -j4 \
BUILD_ENV=Unix \
CXX="ccache emcc -fwasm-exceptions" \
LINKFLAGS="-sEXPORTED_RUNTIME_METHODS=callMain -sALLOW_MEMORY_GROWTH=1" \
LINKLIB="emar rc \$@ \$^" \
AR="emar" \
EXEEXT=".html" \
HOSTCXX="ccache g++" \
HOSTLINKFLAGS=""
- name: Run unit tests
run: node --experimental-wasm-exnref unit/unit_tests.js
- name: Print ccache stats
run: ccache -s
check-vs-2022-make-build-and-test:
runs-on: windows-2022
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Fetch dependencies
run: |
choco install -y --no-progress winflexbison3 strawberryperl wget
if($LastExitCode -ne 0)
{
Write-Output "::error ::Dependency installation via Chocolatey failed."
exit $LastExitCode
}
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
echo "c:\Strawberry\" >> $env:GITHUB_PATH
Invoke-WebRequest -Uri https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-win.zip -OutFile .\z3.zip
Expand-Archive -LiteralPath '.\z3.Zip' -DestinationPath C:\tools
echo "c:\tools\z3-4.8.10-x64-win\bin;" >> $env:GITHUB_PATH
New-Item -ItemType directory "C:\tools\parallel"
wget.exe -O c:\tools\parallel\parallel https://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel
echo "c:\tools\parallel" >> $env:GITHUB_PATH
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Initialise Developer Command Line
uses: ilammy/msvc-dev-cmd@v1
- name: Prepare ccache
uses: actions/cache@v4
with:
save-always: true
path: .ccache
key: ${{ runner.os }}-msbuild-make-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-msbuild-make-${{ github.ref }}
${{ runner.os }}-msbuild-make
- name: ccache environment
run: |
echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV
echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV
- name: Zero ccache stats and limit in size (2 GB)
run: |
clcache -z
clcache -M 2147483648
- name: Download minisat with make
run: make -C lib/cbmc/src minisat2-download
- name: Build EBMC with make
env:
# disable MSYS file-name mangling
MSYS2_ARG_CONV_EXCL: "*"
run: make CXX=clcache BUILD_ENV=MSVC -j4 -C src
- name: Run unit tests
env:
# disable MSYS file-name mangling
MSYS2_ARG_CONV_EXCL: "*"
run: make CXX=clcache BUILD_ENV=MSVC -j4 -C unit
- name: Print ccache stats
run: clcache -s