-
Notifications
You must be signed in to change notification settings - Fork 4
530 lines (473 loc) · 19.9 KB
/
qa-integration.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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# Copyright (c) 2021-2024 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0
name: QA Integration Test
on:
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC
workflow_dispatch: # And manually on button click
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'applications/**'
- 'arch/**'
- 'boards/**'
- 'cmake/**'
- 'drivers/**'
- 'dts/**'
- 'include/**'
- 'lib/**'
- 'modules/**'
- 'samples/**'
- 'tests/**'
- 'soc/**'
- 'subsys/**'
- '**/CMakeLists.txt'
- '**/Kconfig*'
- '**.conf'
- '**.defconfig'
- '**.overlay'
- '**.yaml'
- 'scripts/requirements-*'
- 'scripts/requirements.txt'
- 'west.yml'
- '.github/workflows/qa-integration.yml'
jobs:
qa-samples-integration:
name: Run integration tests for samples
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.27.4
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: tiacsys/clean-after-action@v3
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Restore PIP Cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-qa-pip
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Build samples
working-directory: workspace
run: |
west twister --verbose --jobs 6 \
--retry-failed 5 --retry-interval 60 \
--outdir twister-out --no-clean --inline-logs \
--alt-config-root bridle/zephyr/alt-config/samples \
--integration --no-detailed-test-id \
--testsuite-root bridle/samples \
--testsuite-root zephyr/samples \
--tag bridle \
--tag zephyr
- name: Upload integration test logging
uses: actions/upload-artifact@v4
with:
name: twister-samples.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v4
with:
name: twister-samples.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v4
with:
check_name: twister-report (samples)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-tests-integration:
name: Run integration tests from upstream
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.27.4
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: tiacsys/clean-after-action@v3
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Restore PIP Cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-qa-pip
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Build tests
working-directory: workspace
run: |
west twister --verbose --jobs 6 \
--retry-failed 5 --retry-interval 60 \
--outdir twister-out --no-clean --inline-logs \
--alt-config-root bridle/zephyr/alt-config/tests \
--integration --no-detailed-test-id \
--testsuite-root bridle/tests \
--testsuite-root zephyr/tests \
--tag bridle \
--tag zephyr
- name: Upload integration test logging
uses: actions/upload-artifact@v4
with:
name: twister-tests.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v4
with:
name: twister-tests.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v4
with:
check_name: twister-report (tests)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-shield-integration:
name: Run integration tests for shields
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.27.4
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.17.0
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: tiacsys/clean-after-action@v3
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Restore PIP Cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-qa-pip
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Build integration tests for shields
working-directory: workspace
run: |
#
# Disabled in the meantime because the execution time is still
# too high (up to about 45 min):
#
# --> Grove Button Shields, ~640% more time (~550 more tests)
# --testsuite-root bridle/tests/shields/grove_btn/dts_bindings \
#
# --> Grove LED Shields, ~880% more time (~890 more tests)
# --testsuite-root bridle/tests/shields/grove_led/dts_bindings \
#
west twister --verbose --jobs 6 \
--outdir twister-out --no-clean --inline-logs \
--integration --cmake-only \
--quarantine-list bridle/tests/quarantine.yaml \
--testsuite-root bridle/tests/shields/grove/dts_bindings \
--testsuite-root bridle/tests/shields/x_grove_testbed/dts_bindings
- name: Upload integration test logging
uses: actions/upload-artifact@v4
with:
name: twister-shields.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v4
with:
name: twister-shields.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v4
with:
check_name: twister-report (shields)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-target-integration:
name: Run integration tests on targets
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, linux, gnuarmemb, zephyr-sdk, tiac_magpie]
strategy:
matrix:
board: [magpie_f777ni]
steps:
- name: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: tiacsys/clean-after-action@v3
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Setup Pyhton 3.12 virtual environment
working-directory: workspace
run: |
python3.12 -m venv --clear --copies .env
source .env/bin/activate
echo "$PATH" > $GITHUB_PATH
- name: Install base dependencies
working-directory: workspace
run: |
which python3 && python3 --version
which pip3 && pip3 --version
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Execute integration tests on target
working-directory: workspace
env:
HARDWARE_MAP: bridle/.github/${{ github.job }}/map-${{ matrix.board }}.yml
run: |
#
# Disabled in the meantime because the execution time is still
# too high and most of the core tests are already performed by
# Zephyr in any case:
#
# --tag arm \
# --tag vector_relay \
# --tag kernel \
#
west twister --verbose --jobs 2 \
--retry-failed 5 --retry-interval 60 \
--outdir twister-out --no-clean --inline-logs \
--device-testing --hardware-map ${HARDWARE_MAP} \
--extra-args SHIELD="loopback_test_tmph" \
--alt-config-root bridle/zephyr/alt-config/tests \
--testsuite-root bridle/tests \
--testsuite-root zephyr/tests \
--tag bridle \
--tag hwinfo \
--tag random \
--tag entropy \
--tag watchdog \
--tag counter \
--tag gpio \
--tag spi \
--tag uart \
--tag can
- name: Upload integration test logging
uses: actions/upload-artifact@v4
with:
name: twister-targets.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v4
with:
name: twister-targets.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v4
with:
check_name: twister-report (${{ matrix.board }})
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()