-
-
Notifications
You must be signed in to change notification settings - Fork 0
407 lines (344 loc) · 15 KB
/
build_and_test.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
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
name: Build and test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_TYPE: Debug
permissions:
contents: read
checks: write
jobs:
build_asan_whl:
runs-on: ubuntu-latest
container:
image: sandervocke/shoopdaloop_ubuntu_kinetic_build_base:latest
options: --user root --workdir /
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build ASAN wheel
run: |
python3 -m build -w -C--local=pyproject.toml.debug_asan_overrides
echo "ASAN_CMD_PREFIX_FILE=$(find . -name run_cmd_prefix.txt)" >> $GITHUB_ENV
cd dist
for f in *.whl; do mv -- "$f" "${f%.whl}.asan.whl"; done
echo "ASAN_WHEEL=$(ls *.whl)" >> $GITHUB_ENV
- name: Upload ASAN
uses: actions/upload-artifact@v3
with:
name: asan_wheel
path: dist/${{ env.ASAN_WHEEL }}
- name: Upload ASAN command prefix
uses: actions/upload-artifact@v3
with:
name: asan_cmd_prefix
path: ${{ env.ASAN_CMD_PREFIX_FILE }}
build_debug_whl:
runs-on: ubuntu-latest
container:
image: sandervocke/shoopdaloop_ubuntu_kinetic_build_base:latest
options: --user root --workdir /
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build debug wheel
run: |
python3 -m build -w -C--local=pyproject.toml.debug_overrides
cd dist
for f in *.whl; do mv -- "$f" "${f%.whl}.dbg.whl"; done
echo "DEBUG_WHEEL=$(ls *.whl)" >> $GITHUB_ENV
- name: Upload debug
uses: actions/upload-artifact@v3
with:
name: debug_wheel
path: dist/${{ env.DEBUG_WHEEL }}
build_release_whl:
runs-on: ubuntu-latest
container:
image: sandervocke/shoopdaloop_ubuntu_kinetic_build_base:latest
options: --user root --workdir /
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build release wheel
run: |
python3 -m build -w
cd dist && echo "RELEASE_WHEEL=$(ls *.whl)" >> $GITHUB_ENV
- name: Upload release
uses: actions/upload-artifact@v3
with:
name: release_wheel
path: dist/${{ env.RELEASE_WHEEL }}
# Test the built wheel in an Ubuntu environment using PyPi packages
test_asan_wheel_ubuntu_pypi:
# note: this runs on the build container because that will provide
# the same shared libasan.so used during build
needs: build_asan_whl
runs-on: ubuntu-latest
container:
image: sandervocke/shoopdaloop_ubuntu_kinetic_build_base:latest
options: --user root --workdir /
steps:
- name: Retrieve wheel
uses: actions/download-artifact@v3
with:
name: asan_wheel
path: ~/wheel
- name: Retrieve cmd prefix
uses: actions/download-artifact@v3
with:
name: asan_cmd_prefix
path: ~/asan_cmd_prefix
- name: Set cmd prefix
run: |
ls -la ~/asan_cmd_prefix
echo "ASAN_CMD_PREFIX=$(cat ~/asan_cmd_prefix/run_cmd_prefix.txt)" >> $GITHUB_ENV
- name: Install wheel
run: |
${{ env.ASAN_CMD_PREFIX }} ASAN_OPTIONS=detect_leaks=0 python3 -m pip install ~/wheel/*.whl
echo "ASAN_PKG_DIR=$(${{ env.ASAN_CMD_PREFIX }} ASAN_OPTIONS=detect_leaks=0 shoopdaloop --info | grep "Installed" | sed -r 's/Installed @ //g')" >> $GITHUB_ENV
- name: Report package install dir
run: |
echo "$ASAN_PKG_DIR"
- name: Back-end tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
${{ env.ASAN_CMD_PREFIX }} ${{ env.ASAN_PKG_DIR }}/test_runner --reporter junit --out reports/backend_junit_results.xml
echo "Back-end test results file: $(ls -la reports/backend_junit_results.xml)"
- name: Python tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
${{ env.ASAN_CMD_PREFIX }} ASAN_OPTIONS=detect_leaks=0 pytest ${{ env.ASAN_PKG_DIR }} --junit-xml=reports/python_junit_results.xml
echo "Python test results file: $(ls -la reports/python_junit_results.xml)"
- name: QML tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
${{ env.ASAN_CMD_PREFIX }} ASAN_OPTIONS=detect_leaks=0,new_delete_type_mismatch=0 QT_QPA_PLATFORM=vnc LD_LIBRARY_PATH=$(dirname $(find ${{ env.ASAN_PKG_DIR }}/.. -name libQt6Core.so.6)) python3 ${{ env.ASAN_PKG_DIR }}/run_qml_tests.py -o reports/qml_junit_results.xml,junitxml
echo "QML test results file: $(ls -la reports/qml_junit_results.xml)"
- name: Publish Backend Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/backend_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'backend test (ubuntu pypi asan)'
- name: Publish Python Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/python_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'python test (ubuntu pypi asan)'
- name: Publish QML Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/qml_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'qml test (ubuntu pypi asan)'
test_release_wheel_ubuntu_pypi:
needs: build_release_whl
runs-on: ubuntu-latest
container:
image: sandervocke/shoopdaloop_ubuntu_kinetic_run_base:latest
options: --user root --workdir /
steps:
- name: Retrieve wheel
uses: actions/download-artifact@v3
with:
name: release_wheel
path: ~/wheel
- name: Install wheel
run: |
python3 -m pip install ~/wheel/*.whl
echo "RELEASE_PKG_DIR=$(shoopdaloop --info | grep "Installed" | sed -r 's/Installed @ //g')" >> $GITHUB_ENV
- name: Report package install dir
run: |
echo "$RELEASE_PKG_DIR"
- name: Back-end tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
${{ env.RELEASE_PKG_DIR }}/test_runner --reporter junit --out reports/backend_junit_results.xml
echo "Back-end test results file: $(ls -la reports/backend_junit_results.xml)"
- name: Python tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
pytest ${{ env.RELEASE_PKG_DIR }} --junit-xml=reports/python_junit_results.xml
echo "Python test results file: $(ls -la reports/python_junit_results.xml)"
- name: QML tests
if: success() || failure() # always run even if the previous step fails
run: |
mkdir -p reports
QT_QPA_PLATFORM=vnc LD_LIBRARY_PATH=$(dirname $(find ${{ env.RELEASE_PKG_DIR }}/.. -name libQt6Core.so.6)) python3 ${{ env.RELEASE_PKG_DIR }}/run_qml_tests.py -o reports/qml_junit_results.xml,junitxml
echo "QML test results file: $(ls -la reports/qml_junit_results.xml)"
- name: App runs and closes gracefully
if: success() || failure() # always run even if the previous step fails
run: |
QT_QPA_PLATFORM=vnc EXPECT_STAY_OPEN=1 WAIT_MS_BEFORE_CLOSE=5000 N_ITERATIONS=10 WAIT_MS_BEFORE_KILL=10000 ${{ env.RELEASE_PKG_DIR }}/scripts/test_run_app.sh shoopdaloop -b dummy
- name: Publish Backend Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/backend_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'backend test (ubuntu pypi release)'
- name: Publish Python Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/python_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'python test (ubuntu pypi release)'
- name: Publish QML Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'reports/qml_junit_results.xml'
detailed_summary: true
include_passed: true
check_name: 'qml test (ubuntu pypi release)'
# # Test the built wheel in an Arch environment with dependencies pre-installed.
# test_wheel_arch_systempackages:
# needs: build_whl
# runs-on: ubuntu-latest
# container:
# image: sandervocke/shoopdaloop_run_arch:latest
# options: --user root --workdir /
# steps:
# - name: Retrieve wheel
# uses: actions/download-artifact@v3
# with:
# name: wheel
# path: ~/wheel
# - name: Install wheel
# run: |
# echo "::warning title=PACKAGING_ISSUE::Temporarily removed --no-deps on Arch because of broken python-numba"
# python3 -m pip install ~/wheel/*.whl --break-system-packages
# echo "PKG_DIR=$(python3 -m pip show shiboken6 | grep "Location:" | sed -r 's/Location: //g')" >> $GITHUB_ENV
# - name: Back-end tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# ${{ env.PKG_DIR }}/shoopdaloop/test_runner --reporter junit --out reports/backend_junit_results.xml
# echo "Back-end test results file: $(ls -la reports/backend_junit_results.xml)"
# - name: Python tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# pytest ${{ env.PKG_DIR }}/shoopdaloop --junit-xml=reports/python_junit_results.xml
# echo "Python test results file: $(ls -la reports/python_junit_results.xml)"
# - name: QML tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# QT_QPA_PLATFORM=vnc ${{ env.PKG_DIR }}/shoopdaloop/run_qml_tests.py -o reports/qml_junit_results.xml,junitxml
# echo "QML test results file: $(ls -la reports/qml_junit_results.xml)"
# - name: App runs and closes gracefully
# if: success() || failure() # always run even if the previous step fails
# run: |
# QT_QPA_PLATFORM=vnc EXPECT_STAY_OPEN=1 WAIT_MS_BEFORE_CLOSE=5000 N_ITERATIONS=10 WAIT_MS_BEFORE_KILL=10000 ${{ env.PKG_DIR }}/shoopdaloop/scripts/test_run_app.sh shoopdaloop
# - name: Publish Backend Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/backend_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'backend test (arch system)'
# - name: Publish Python Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/python_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'python test (arch system)'
# - name: Publish QML Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/qml_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'qml test (arch system)'
# # Test the built wheel in an Ubuntu environment with dependencies pre-installed.
# test_wheel_ubuntu_systempackages:
# needs: build_whl
# runs-on: ubuntu-latest
# container:
# image: sandervocke/shoopdaloop_run_ubuntu:latest
# options: --user root --workdir /
# steps:
# - name: Retrieve wheel
# uses: actions/download-artifact@v3
# with:
# name: wheel
# path: ~/wheel
# - name: Install wheel
# run: |
# python3 -m pip install --no-deps --break-system-packages ~/wheel/*.whl
# echo "PKG_DIR=$(python3 -m pip show shiboken6 | grep "Location:" | sed -r 's/Location: //g')" >> $GITHUB_ENV
# - name: Back-end tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# ${{ env.PKG_DIR }}/shoopdaloop/test_runner --reporter junit --out reports/backend_junit_results.xml
# echo "Back-end test results file: $(ls -la reports/backend_junit_results.xml)"
# - name: Python tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# pytest ${{ env.PKG_DIR }}/shoopdaloop --junit-xml=reports/python_junit_results.xml
# echo "Python test results file: $(ls -la reports/python_junit_results.xml)"
# - name: QML tests
# if: success() || failure() # always run even if the previous step fails
# run: |
# mkdir -p reports
# QT_QPA_PLATFORM=vnc ${{ env.PKG_DIR }}/shoopdaloop/run_qml_tests.py -o reports/qml_junit_results.xml,junitxml
# echo "QML test results file: $(ls -la reports/qml_junit_results.xml)"
# - name: App runs and closes gracefully
# if: success() || failure() # always run even if the previous step fails
# run: |
# QT_QPA_PLATFORM=vnc EXPECT_STAY_OPEN=1 WAIT_MS_BEFORE_CLOSE=5000 N_ITERATIONS=10 WAIT_MS_BEFORE_KILL=10000 ${{ env.PKG_DIR }}/shoopdaloop/scripts/test_run_app.sh shoopdaloop
# - name: Publish Backend Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/backend_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'backend test (ubuntu system)'
# - name: Publish Python Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/python_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'python test (ubuntu system)'
# - name: Publish QML Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: 'reports/qml_junit_results.xml'
# detailed_summary: true
# include_passed: true
# check_name: 'qml test (ubuntu system)'