forked from avocado-framework/avocado
-
Notifications
You must be signed in to change notification settings - Fork 0
640 lines (564 loc) · 23.1 KB
/
ci.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
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
name: GH Actions
on:
pull_request:
workflow_dispatch:
jobs:
static-checks:
name: Static checks
runs-on: ubuntu-20.04
container:
image: quay.io/avocado-framework/avocado-ci-fedora-38
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Allow git to operate on directory checked out by GH Actions
run: git config --global --add safe.directory `pwd`
- name: Installing Avocado development dependencies
run: make requirements-dev
- name: Installing Avocado in develop mode
run: python3 setup.py develop --user
- name: Run static checks
env:
COMMIT_COUNT: ${{ github.event.pull_request.commits }}
run: python3 setup.py test --select=static-checks
- name: Archive failed tests logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: static-checks-logs
path: /home/runner/avocado/job-results/
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."
smokecheck-linux:
name: Smokecheck on Linux with Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.0, 3.11, 3.12.0]
fail-fast: false
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools on Python 3.12
run: python3 -c 'import setuptools' || python3 -m pip install setuptools
- name: Avocado smokecheck
run: make smokecheck
check-linux:
name: Linux with Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
needs: smokecheck-linux
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.0, 3.11, 3.12.0]
fail-fast: false
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -V --version
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Install setuptools on Python 3.12
run: python3 -c 'import setuptools' || python3 -m pip install setuptools
- name: Installing Avocado in develop mode
run: python3 setup.py develop --user
- name: Avocado version
run: avocado --version
- name: Unittests and fast functional tests
run: python3 setup.py test --skip=static-checks
- name: Archive failed tests logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: linux-logs-${{ matrix.python-version }}
path: /home/runner/avocado/job-results/
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."
code-coverage:
name: Code Coverage
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.11]
env:
CC_TEST_REPORTER_ID: "387887b88a76f31c2c376219fc749689ea5975c8fe7fcd9609f1dcc139e053a6"
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
pip install -r requirements-dev.txt
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Run pre script
run: ./cc-test-reporter before-build
- name: Run script
run: make develop && ./selftests/run_coverage
- name: Run post script
run: ./cc-test-reporter after-build
- run: echo "🥑 This job's status is ${{ job.status }}."
# macOS check on latest Python
check-macos:
name: macOS with Python ${{ matrix.python-version }}
runs-on: macos-12
strategy:
matrix:
python-version: [3.11.1]
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -V --version
- name: Install avocado
run: |
python3 -m pip install -r requirements-dev.txt
python setup.py develop --user
- name: Show avocado help
run: python -m avocado --help
- name: Example test
run: python -m avocado run examples/tests/passtest.py
- name: List test
run: python -m avocado --verbose list selftests/unit/* selftests/functional/* selftests/*sh
- name: Run a subset of avocado's selftests
run: PATH=~/Library/Python/3.11/bin:$PATH ./selftests/check.py --skip=static-checks
- run: echo "🥑 This job's status is ${{ job.status }}."
# Windows checks on latest Python
smokecheck-windows:
name: Windows with Python ${{ matrix.python-version }}
runs-on: windows-2019
strategy:
matrix:
python-version: [3.9, 3.10.0, 3.11, 3.12.0]
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -V --version
- name: Install setuptools on Python 3.12
run: python -c 'import setuptools' || python -m pip install setuptools
- name: Install avocado
run: python setup.py develop --user
- name: Show avocado help
run: python -m avocado --help
- name: Example test
run: python -m avocado run examples\tests\passtest.py
- run: echo "🥑 This job's status is ${{ job.status }}."
# Checks that Python packages builds succeeds
package-build:
name: Build Package (wheel/tarball) for Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.0, 3.11, 3.12.0]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools on Python 3.12
run: python3 -c 'import setuptools' || python3 -m pip install setuptools
- name: Build tarballs and wheels
run: make -f Makefile.gh build-wheel check-wheel
- name: Save tarballs and wheels as artifacts
uses: actions/upload-artifact@v3
with:
name: tarballs_and_wheels-${{ matrix.python-version }}
path: ${{github.workspace}}/PYPI_UPLOAD/
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."
egg-build:
name: Build Egg for Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.0, 3.11, 3.12.0]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools on Python 3.12
run: python3 -c 'import setuptools' || python3 -m pip install setuptools
- name: Build eggs
run: make -f Makefile.gh build-egg
- name: Save eggs as artifacts
uses: actions/upload-artifact@v3
with:
name: eggs-${{ matrix.python-version }}
path: ${{github.workspace}}/EGG_UPLOAD/
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."
experimental-checks:
name: Experimental checks
runs-on: ubuntu-20.04
steps:
- run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}"
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run Codespell Check
run: make -f Makefile.gh codespell
- name: Run bandit check
run: make -f Makefile.gh bandit
continue-on-error: True
- name: Save bandit output as artifacts
uses: actions/upload-artifact@v3
with:
name: bandit-results
path: /home/runner/work/avocado/avocado/bandit-output.txt
retention-days: 1
- run: echo "🥑 This job's status is ${{ job.status }}."
version_task_fedora_37:
name: Version task fedora:37
runs-on: ubuntu-20.04
container:
image: fedora:37
steps:
- name: Install Python dependencies
run: dnf -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_fedora_38:
name: Version task fedora:38
runs-on: ubuntu-20.04
container:
image: fedora:38
steps:
- name: Install Python dependencies
run: dnf -y install python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_ubi_8:
name: Version task ubi:8.8
runs-on: ubuntu-20.04
container:
image: registry.access.redhat.com/ubi8/ubi:8.8
steps:
- name: Install Python dependencies
run: dnf -y install python38 python38-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_ubi_9:
name: Version task ubi:9.2
runs-on: ubuntu-20.04
container:
image: registry.access.redhat.com/ubi9/ubi:9.2
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_debian_10:
name: Version task debian:10.10
runs-on: ubuntu-20.04
container:
image: debian:10.10
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_debian_11:
name: Version task debian:11.0
runs-on: ubuntu-20.04
container:
image: debian:11.0
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_ubuntu_21:
name: Version task ubuntu:21.10
runs-on: ubuntu-20.04
container:
image: ubuntu:21.10
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
version_task_ubuntu_20:
name: Version task ubuntu:20.04
runs-on: ubuntu-20.04
container:
image: ubuntu:20.04
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and run avocado --version
run: |
python3 setup.py develop --user
python3 -m avocado --version
egg_task_fedora_37:
name: Egg task fedora:37
runs-on: ubuntu-20.04
container:
image: fedora:37
steps:
- name: Install Python dependencies
run: dnf -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_fedora_38:
name: Egg task fedora:38
runs-on: ubuntu-20.04
container:
image: fedora:38
steps:
- name: Install Python dependencies
run: dnf -y install python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_ubi_8:
name: Egg task ubi:8.8
runs-on: ubuntu-20.04
container:
image: registry.access.redhat.com/ubi8/ubi:8.8
steps:
- name: Install Python dependencies
run: dnf -y install python38 python38-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_ubi_9:
name: Egg task ubi:9.2
runs-on: ubuntu-20.04
container:
image: registry.access.redhat.com/ubi9/ubi:9.2
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_debian_10:
name: Egg task debian:10.10
runs-on: ubuntu-20.04
container:
image: debian:10.10
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_debian_11:
name: Egg task debian:11.0
runs-on: ubuntu-20.04
container:
image: debian:11.0
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_ubuntu_21:
name: Egg task ubuntu:21.10
runs-on: ubuntu-20.04
container:
image: ubuntu:21.10
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
egg_task_ubuntu_20:
name: Egg task ubuntu:20.04
runs-on: ubuntu-20.04
container:
image: ubuntu:20.04
steps:
- name: Install Python dependencies
run: apt update && apt -y install python3 python3-setuptools
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs
run: |
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp
python3 setup.py clean --all
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true
cd /tmp
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true
podman_egg_task:
name: Podman Egg task
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from eggs under Podman spawner
run: |
apt update && apt -y install python3 python3-setuptools
python3 setup.py bdist_egg
mv dist/avocado_framework-*egg /tmp/avocado_framework.egg
python3 setup.py clean --all
python3 -c 'import sys; sys.path.insert(0, "/tmp/avocado_framework.egg"); from avocado.core.main import main; sys.exit(main())' run --spawner=podman --spawner-podman-image=fedora:38 --spawner-podman-avocado-egg=file:///tmp/avocado_framework.egg -- /bin/true
podman_external_runner_task:
name: Podman spawner with 3rd party runner plugin
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Test running avocado from released eggs under Podman spawner with 3rd party plugins
run: |
apt update && apt -y install python3 python3-setuptools
python3 setup.py develop --user
cd examples/plugins/tests/magic
python3 setup.py develop --user
cd ../../../../
python3 -m avocado -V list -- magic:pass magic:fail | grep "magic: 2"
podman pull quay.io/avocado-framework/avocado-ci-magic
python3 -m avocado run --spawner=podman --spawner-podman-image=quay.io/avocado-framework/avocado-ci-magic -- magic:pass
tail -n1 ~/avocado/job-results/latest/results.tap | grep "ok 1 magic:pass"
python3 -m avocado run --spawner=podman --spawner-podman-image=quay.io/avocado-framework/avocado-ci-magic -- magic:fail || true
tail -n1 ~/avocado/job-results/latest/results.tap | grep "not ok 1 magic:fail"
fedora_develop_install_uninstall_task:
name: Fedora develop install/uninstall task
runs-on: ubuntu-latest
container:
image: fedora:38
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Test avocado install/uninstall
run: |
python3 -c 'import setuptools' || dnf -y install python3 python3-setuptools
python3 setup.py develop --user
test `python3 -m avocado plugins | grep ^html | wc -l` -eq "3"
test `python3 -m avocado plugins | grep ^robot | wc -l` -eq "2"
python3 setup.py develop --user --uninstall
python3 setup.py clean --all
python3 setup.py develop --user --skip-optional-plugins
python3 -m avocado --version
test `python3 -m avocado plugins | grep ^html | wc -l` -eq "0"
test `python3 -m avocado plugins | grep ^robot | wc -l` -eq "0"
fedora_selftests_task:
name: Fedora selftests
runs-on: ubuntu-latest
container:
image: quay.io/avocado-framework/avocado-ci-fedora-36
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Run unittests and functional tests
run: |
make develop
PATH=$HOME/.local/bin:$PATH LANG=en_US.UTF-8 AVOCADO_CHECK_LEVEL=0 python3 selftests/check.py --skip static-checks