-
Notifications
You must be signed in to change notification settings - Fork 76
306 lines (290 loc) · 13.6 KB
/
buildtest.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
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
name: Build Test
# Builds and tests storm on various platforms
# also deploys images to Dockerhub
on:
schedule:
# run daily
- cron: '0 6 * * *'
# needed to trigger the workflow manually
workflow_dispatch:
pull_request:
env:
# GitHub runners currently have 4 cores
NR_JOBS: "4"
jobs:
# Perform in-depth tests with different configurations
indepthTests:
name: Indepth Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }})
runs-on: ubuntu-latest
strategy:
matrix:
config:
- {name: "GMP exact; GMP rational functions; All dependencies",
baseImg: "storm-dependencies:latest-debug",
buildType: "Debug",
Gurobi: "ON",
Soplex: "ON",
Spot: "ON",
Developer: "ON",
ClnExact: "OFF",
ClnRatfunc: "OFF",
AllSanitizers: "ON",
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5"
}
- {name: "CLN exact; GMP rational functions; All dependencies",
baseImg: "storm-dependencies:latest-debug",
buildType: "Debug",
Gurobi: "ON",
Soplex: "ON",
Spot: "ON",
Developer: "ON",
ClnExact: "ON",
ClnRatfunc: "OFF",
AllSanitizers: "ON",
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5"
}
- {name: "CLN exact; CLN rational functions; All dependencies",
baseImg: "storm-dependencies:latest-debug",
buildType: "Debug",
Gurobi: "ON",
Soplex: "ON",
Spot: "ON",
Developer: "ON",
ClnExact: "ON",
ClnRatfunc: "ON",
AllSanitizers: "ON",
cmakeArgs: "-DMSAT_ROOT=/opt/mathsat5"
}
- {name: "GMP exact; CLN rational functions; No dependencies",
baseImg: "storm-dependencies:latest-debug",
buildType: "Debug",
Gurobi: "OFF",
Soplex: "OFF",
Spot: "OFF",
Developer: "ON",
ClnExact: "OFF",
ClnRatfunc: "ON",
AllSanitizers: "ON",
cmakeArgs: "-DMSAT_ROOT="
}
- {name: "Minimal dependencies",
baseImg: "storm-basesystem:minimal_dependencies",
buildType: "Debug",
Gurobi: "OFF",
Soplex: "OFF",
Spot: "OFF",
Developer: "ON",
ClnExact: "OFF",
ClnRatfunc: "ON",
AllSanitizers: "ON",
cmakeArgs: "-DMSAT_ROOT="
}
steps:
- name: Git clone
uses: actions/checkout@v4
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:ci . \
--build-arg BASE_IMG=movesrwth/${{ matrix.config.baseImg }} \
--build-arg build_type="${{ matrix.config.buildType }}" \
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \
--build-arg soplex_support="${{ matrix.config.Soplex }}" \
--build-arg spot_support="${{ matrix.config.Spot }}" \
--build-arg developer="${{ matrix.config.Developer }}" \
--build-arg cln_exact="${{ matrix.config.ClnExact }}" \
--build-arg cln_ratfunc="${{ matrix.config.ClnRatfunc }}" \
--build-arg all_sanitizers="${{ matrix.config.AllSanitizers }}" \
--build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci movesrwth/storm:ci
# A bit hacky... but its usefulness has been proven in production
- name: Check release makeflags
if: matrix.config.buildType == 'Release'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
- name: Check debug makeflags
if: matrix.config.buildType == 'Debug'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
- name: Build tests
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
- name: Run tests
run: docker exec ci bash -c "cd /opt/storm/build; ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0 ctest test --output-on-failure"
compilerTests:
# Build and run with different compilers (GCC, Clang)
# Run on latest Archlinux version to get most recent compiler versions
name: Compiler Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }})
runs-on: ubuntu-latest
strategy:
matrix:
config:
- {name: "GCC",
buildType: "Debug",
Gurobi: "OFF",
Soplex: "OFF",
Spot: "OFF",
Developer: "ON",
cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_USE_SPOT_SHIPPED=ON",
packages: ""
}
- {name: "Clang",
buildType: "Debug",
Gurobi: "OFF",
Soplex: "OFF",
Spot: "OFF",
Developer: "ON",
cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_USE_SPOT_SHIPPED=ON",
packages: "clang"
}
steps:
- name: Git clone
uses: actions/checkout@v4
- name: Replace Dockerfile
run: cp .github/workflows/Dockerfile.archlinux Dockerfile
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:ci . \
--build-arg build_type="${{ matrix.config.buildType }}" \
--build-arg gurobi_support="${{ matrix.config.Gurobi }}" \
--build-arg soplex_support="${{ matrix.config.Soplex }}" \
--build-arg spot_support="${{ matrix.config.Spot }}" \
--build-arg developer="${{ matrix.config.Developer }}" \
--build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \
--build-arg packages="${{ matrix.config.packages }}" \
--build-arg no_threads=${NR_JOBS}
# Omitting arguments cln_exact, cln_ratfunc, all_sanitizers
- name: Run Docker
run: docker run -d -it --name ci movesrwth/storm:ci
# A bit hacky... but its usefulness has been proven in production
- name: Check release makeflags
if: matrix.config.buildType == 'Release'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
- name: Check debug makeflags
if: matrix.config.buildType == 'Debug'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
- name: Build tests
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
- name: Run tests
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure"
distroTests:
name: Distro Tests (${{ matrix.distro }}, ${{ matrix.buildType }})
runs-on: ubuntu-latest
strategy:
matrix:
distro: ["debian-12", "ubuntu-22.04", "ubuntu-24.04"]
buildType: ["Release"]
steps:
- name: Git clone
uses: actions/checkout@v4
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:ci . \
--build-arg BASE_IMG=movesrwth/storm-basesystem:${{ matrix.distro }} \
--build-arg build_type="${{ matrix.buildType }}" \
--build-arg gurobi_support="OFF" \
--build-arg soplex_support="OFF" \
--build-arg spot_support="OFF" \
--build-arg no_threads=${NR_JOBS}
# Omitting arguments developer, cln_exact, cln_ratfunc, all_sanitizers, cmake_args
- name: Run Docker
run: docker run -d -it --name ci movesrwth/storm:ci
# A bit hacky... but its usefulness has been proven in production
- name: Check release makeflags
if: matrix.buildType == 'Release'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
- name: Check debug makeflags
if: matrix.buildType == 'Debug'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
- name: Build tests
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
- name: Run tests
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure"
deploy:
name: Test and Deploy (${{ matrix.buildType.name }})
runs-on: ubuntu-latest
strategy:
matrix:
buildType:
- {name: "Debug",
dockerTag: "ci-debug",
baseImg: "storm-dependencies:latest-debug",
Developer: "ON"
}
- {name: "Release",
dockerTag: "ci",
baseImg: "storm-dependencies:latest",
Developer: "OFF"
}
steps:
- name: Git clone
uses: actions/checkout@v4
- name: Git describe
id: ghd
uses: proudust/gh-describe@v2
- name: Set static Storm version
run: echo "set(STORM_VERSION_COMMITS_AHEAD ${{ steps.ghd.outputs.distance }})" >> version.cmake
- name: Build storm from Dockerfile
run: |
docker build -t movesrwth/storm:${{ matrix.buildType.dockerTag }} . \
--build-arg BASE_IMG=movesrwth/${{ matrix.buildType.baseImg }} \
--build-arg build_type="${{ matrix.buildType.name }}" \
--build-arg developer="${{ matrix.buildType.Developer }}" \
--build-arg cmake_args="${{ matrix.buildType.cmakeArgs }}" \
--build-arg no_threads=${NR_JOBS}
# Omitting arguments gurobi_support, soplex_support, spot_support, cln_exact, cln_ratfunc, all_sanitizers
- name: Run Docker
run: docker run -d -it --name ci movesrwth/storm:${{ matrix.buildType.dockerTag }}
# A bit hacky... but its usefulness has been proven in production
- name: Check release makeflags
if: matrix.buildType.name == 'Release'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -O3' || (echo \"Error: Missing flag \'-O3\' for release build.\" && false)"
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -DNDEBUG' || (echo \"Error: Missing flag \'-DNDEBUG\' for release build.\" && false)"
- name: Check debug makeflags
if: matrix.buildType.name == 'Debug'
run: |
docker exec ci bash -c "/opt/storm/build/bin/storm --version | grep 'with flags .* -g' || (echo \"Error: Missing flag \'-g\' for debug build.\" && false)"
- name: Build tests
run: docker exec ci bash -c "cd /opt/storm/build; make -j ${NR_JOBS}"
- name: Run tests
run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure"
- name: Login into docker
# Only login if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master'
run: echo "${{ secrets.STORM_CI_DOCKER_PASSWORD }}" | docker login -u "${{ secrets.STORM_CI_DOCKER_USERNAME }}" --password-stdin
- name: Deploy storm
# Only deploy if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master'
run: |
docker commit ci movesrwth/storm:${{ matrix.buildType.dockerTag }}
docker push movesrwth/storm:${{ matrix.buildType.dockerTag }}
notify:
name: Email notification
runs-on: ubuntu-latest
needs: [indepthTests, compilerTests, distroTests, deploy]
# Only run in main repo and even if previous step failed
if: github.repository_owner == 'moves-rwth' && always()
steps:
- uses: technote-space/workflow-conclusion-action@v3
- uses: dawidd6/action-send-mail@v4
with:
server_address: ${{ secrets.STORM_CI_MAIL_SERVER }}
server_port: 587
username: ${{ secrets.STORM_CI_MAIL_USERNAME }}
password: ${{ secrets.STORM_CI_MAIL_PASSWORD }}
subject: "[You broke it] CI run failed for ${{ github.repository }}"
body:
"CI job of ${{ github.repository }} has failed for commit ${{ github.sha }}.\n\
The error type is: ${{ env.WORKFLOW_CONCLUSION }}.\n\n\
For more information, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
to: ${{ secrets.STORM_CI_MAIL_RECIPIENTS }}
from: Github Actions <[email protected]>
if: env.WORKFLOW_CONCLUSION != 'success' # notify only if failure