-
Notifications
You must be signed in to change notification settings - Fork 20
380 lines (364 loc) · 15.8 KB
/
Copy pathbuildtest.yml
File metadata and controls
380 lines (364 loc) · 15.8 KB
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
name: Build Test
# Builds and tests stormpy with different versions of Storm
# also deploys images to Dockerhub
on:
push:
branches:
- master
schedule:
# run weekly
- cron: '0 10 * * 3'
# needed to trigger the workflow manually
workflow_dispatch:
pull_request:
env:
# GitHub runners currently have 4 cores
NR_JOBS: "4"
jobs:
indepthTests:
name: Indepth Tests (${{ matrix.build_type.name }}, ${{ matrix.config.name }})
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- {name: "Debug",
storm_base: "ci-debug",
build_args: "Debug",
}
- {name: "Release",
storm_base: "ci",
build_args: "Release",
}
config:
- {name: "all libraries",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[numpy,plot,test]",
test_opt: ""
}
- {name: "no libraries",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF --config-settings=cmake.define=USE_STORM_DFT=OFF --config-settings=cmake.define.USE_STORM_GSPN=OFF --config-settings=cmake.define.USE_STORM_PARS=OFF --config-settings=cmake.define.USE_STORM_POMDP=OFF --config-settings=cmake.define.USE_PARSER=OFF",
optional_libs: "[test]",
test_opt: "tests"
}
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Build stormpy from Dockerfile
run: |
docker build -t movesrwth/stormpy:ci . \
--build-arg STORM_BASE=movesrwth/storm:${{ matrix.build_type.storm_base }} \
--build-arg build_type=${{ matrix.build_type.name }} \
--build-arg setup_args="${{ matrix.config.setup_args }}" \
--build-arg options=${{ matrix.config.optional_libs }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci movesrwth/stormpy:ci
- name: Run tests
run: docker exec ci bash -c "cd /opt/stormpy; pytest ${{ matrix.config.test_opt }}"
stableTests:
name: Test on stable (${{ matrix.build_type.name }})
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- {name: "Debug",
storm_base: "stable-debug",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot]"
}
- {name: "Release",
storm_base: "stable",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot]"
}
# Allow failures of stable versions as new features might have been added
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Replace Dockerfile
run: cp .github/workflows/Dockerfile.stable Dockerfile
- name: Build dependencies
run: |
docker build -t movesrwth/stormpy:ci . \
--build-arg STORM_BASE=movesrwth/storm:${{ matrix.build_type.storm_base }} \
--build-arg build_type=${{ matrix.build_type.build_type }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci movesrwth/stormpy:ci
- name: Build stormpy
# Build stormpy explicitly to catch exit code
id: build_stormpy
shell: bash {0} // Deactivate fast-fail to handle exit code for incompatibility
run: |
docker exec ci bash -c "cd /opt/stormpy; pip install -v --config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${NR_JOBS} --config-settings=cmake.build-type=${{ matrix.build_type.build_type }} --config-settings=cmake.define.CARLPARSER_DIR_HINT=/opt/carl-parser/build/ ${{ matrix.build_type.setup_args }} .${{ matrix.build_type.optional_libs }}"
status=$?
if [ $status -eq 1 ]; then
# Warn about possible incompatibility but do not handle as failure
echo "::warning file=CMakeLists.txt,line=52::Stormpy might be incompatible with stable version of Storm"
# Deactivate tests
echo "run_tests=false" >> $GITHUB_OUTPUT
else
echo "run_tests=true" >> $GITHUB_OUTPUT
exit $status
fi
- name: Run tests
if: steps.build_stormpy.outputs.run_tests == 'true'
run: docker exec ci bash -c "cd /opt/stormpy; pytest"
linuxTests:
name: Linux Test (Fetch, ${{ matrix.config.name }})
runs-on: ubuntu-latest
strategy:
matrix:
config:
- {name: "Debian 12, Debug",
base_image: "movesrwth/storm-basesystem:debian-12",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]",
test_opt: ""
}
- {name: "Debian 13, Debug",
base_image: "movesrwth/storm-basesystem:debian-13",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]",
test_opt: ""
}
- {name: "Ubuntu 24.04, Debug",
base_image: "movesrwth/storm-basesystem:ubuntu-24.04",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]",
test_opt: ""
}
- {name: "Ubuntu 24.04, Debug, only Storm core",
base_image: "movesrwth/storm-basesystem:ubuntu-24.04",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master --config-settings=cmake.define.USE_STORM_DFT=OFF --config-settings=cmake.define.USE_STORM_GSPN=OFF --config-settings=cmake.define.USE_STORM_PARS=OFF --config-settings=cmake.define.USE_STORM_POMDP=OFF --config-settings=cmake.define.USE_PARSER=OFF",
optional_libs: "[test]",
test_opt: "tests"
}
- {name: "Ubuntu 24.04, Release",
base_image: "movesrwth/storm-basesystem:ubuntu-24.04",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]",
test_opt: ""
}
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Replace Dockerfile
run: cp .github/workflows/Dockerfile.fetch Dockerfile
- name: Build stormpy
run: |
docker build -t movesrwth/stormpy:ci . \
--build-arg BASE_IMAGE=${{ matrix.config.base_image }} \
--build-arg build_type=${{ matrix.config.build_type }} \
--build-arg setup_args="${{ matrix.config.setup_args }}" \
--build-arg options=${{ matrix.config.optional_libs }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci movesrwth/stormpy:ci
- name: Run tests
run: docker exec ci bash -c "cd /opt/stormpy; pytest ${{ matrix.config.test_opt }}"
macFetchTests:
name: Mac Tests (Fetch, ${{ matrix.config.name }})
strategy:
matrix:
config:
- {name: "MacOS 14, ARM, Debug",
distro: "macos-14",
xcode: "15.4",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]"
}
- {name: "MacOS 15, ARM, Debug",
distro: "macos-15",
xcode: "16.4",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]"
}
- {name: "MacOS 26, ARM, Debug",
distro: "macos-26",
xcode: "latest-stable",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]"
}
- {name: "MacOS 26, Intel, Debug",
distro: "macos-26-intel",
xcode: "latest-stable",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_SYSTEM=OFF --config-settings=cmake.define.STORM_GIT_TAG=master",
optional_libs: "[test,plot]"
}
runs-on: ${{ matrix.config.distro }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.config.xcode }}
- name: Git clone
uses: actions/checkout@v6
- name: Install dependencies
# cmake and gmp and python3 are already installed
run: |
brew update
brew install automake boost cln ginac glpk hwloc libarchive xerces-c z3
- name: Build stormpy
run: |
pip install -v \
--config-settings=cmake.build-type=${{ matrix.config.build_type }} \
--config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${NR_JOBS} \
${{ matrix.config.setup_args }} .${{ matrix.config.optional_libs }}
- name: Run tests
run: pytest
macInstallTests:
name: Mac Tests (Install, ${{ matrix.config.name }})
strategy:
matrix:
config:
- {name: "MacOS 26, ARM, Debug",
distro: "macos-26",
xcode: "latest-stable",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot]"
}
- {name: "MacOS 26, ARM, Release",
distro: "macos-26",
xcode: "latest-stable",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot]"
}
runs-on: ${{ matrix.config.distro }}
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.config.xcode }}
- name: Git clone
uses: actions/checkout@v6
- name: Install dependencies
# cmake and gmp and python3 are already installed
run: |
brew update
brew install automake boost cln ginac glpk hwloc libarchive xerces-c z3
- name: Checkout Storm
uses: actions/checkout@v6
with:
repository: stormchecker/storm
ref: master
path: storm
- name: Build and install Storm
working-directory: storm
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.build_type }}" -DSTORM_BUILD_TESTS=OFF -DSTORM_BUILD_EXECUTABLES=OFF
make -j ${NR_JOBS}
sudo make install
cd ..
rm -rf build
- name: Build stormpy
run: |
pip install -v \
--config-settings=cmake.build-type=${{ matrix.config.build_type }} \
--config-settings=cmake.define.CMAKE_BUILD_PARALLEL_LEVEL=${NR_JOBS} \
${{ matrix.config.setup_args }} .${{ matrix.config.optional_libs }}
- name: Run tests
run: pytest
deploy:
name: Test and Deploy on latest (${{ matrix.build_type.name }})
runs-on: ubuntu-latest
permissions:
# Needed for documentation deployment
contents: write
strategy:
matrix:
build_type:
- {name: "Debug",
docker_tag: "ci-debug",
storm_base: "ci-debug",
build_type: "Debug",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot]"
}
- {name: "Release",
docker_tag: "ci",
storm_base: "ci",
build_type: "Release",
setup_args: "--config-settings=cmake.define.ALLOW_STORM_FETCH=OFF",
optional_libs: "[test,plot,doc]"
}
steps:
- name: Git clone
uses: actions/checkout@v6
- name: Build stormpy from Dockerfile
run: |
docker build -t movesrwth/stormpy:${{ matrix.build_type.docker_tag }} . \
--build-arg STORM_BASE=movesrwth/storm:${{ matrix.build_type.storm_base }} \
--build-arg build_type=${{ matrix.build_type.build_type }} \
--build-arg setup_args="${{ matrix.build_type.setup_args }}" \
--build-arg options=${{ matrix.build_type.optional_libs }} \
--build-arg no_threads=${NR_JOBS}
- name: Run Docker
run: docker run -d -it --name ci movesrwth/stormpy:${{ matrix.build_type.docker_tag }}
- name: Run tests
run: docker exec ci bash -c "cd /opt/stormpy; pytest"
- name: Login into docker
# Only login if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'stormchecker' && github.ref == 'refs/heads/master'
uses: docker/login-action@v4
with:
username: ${{ secrets.STORM_CI_DOCKER_USERNAME }}
password: ${{ secrets.STORM_CI_DOCKER_TOKEN }}
- name: Deploy stormpy
# Only deploy if using master on original repo (and not for pull requests or forks)
if: github.repository_owner == 'stormchecker' && github.ref == 'refs/heads/master'
run: |
docker commit ci movesrwth/stormpy:${{ matrix.build_type.docker_tag }}
docker push movesrwth/stormpy:${{ matrix.build_type.docker_tag }}
- name: Install documentation dependencies
if: matrix.build_type.name == 'Release'
run: |
docker exec ci apt-get install -qq -y pandoc
- name: Build documentation
if: matrix.build_type.name == 'Release'
run: |
docker exec ci bash -c "cd /opt/stormpy/doc; make html"
docker exec ci rm -r /opt/stormpy/doc/build/html/_sources
docker cp ci:/opt/stormpy/doc/build/html .
- name: Deploy documentation
# Only deploy for release version and using master on original repo (and not for pull requests or forks)
if: matrix.build_type.name == 'Release' && github.repository_owner == 'stormchecker' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html
notify:
name: Email notification
runs-on: ubuntu-latest
needs: [indepthTests, stableTests, linuxTests, macFetchTests, macInstallTests, deploy]
# Only run in main repo and even if previous step failed
if: github.repository_owner == 'stormchecker' && always()
steps:
- uses: technote-space/workflow-conclusion-action@v3
- uses: dawidd6/action-send-mail@v17
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 <you-broke-it@stormchecker.org>
if: env.WORKFLOW_CONCLUSION != 'success' # notify only if failure