1
1
---
2
- name : QEMU/KVM Integration tests
2
+ name : Test
3
3
on : # yamllint disable-line rule:truthy
4
4
pull_request :
5
5
merge_group :
@@ -17,18 +17,34 @@ permissions:
17
17
# This is required for the ability to create/update the Pull request status
18
18
statuses : write
19
19
jobs :
20
- qemu_kvm :
20
+ scenario :
21
21
runs-on : ubuntu-latest
22
22
23
23
strategy :
24
24
fail-fast : false
25
25
matrix :
26
26
scenario :
27
+ # QEMU
27
28
- { image: "centos-9", env: "qemu-ansible-core-2.16" }
28
29
- { image: "centos-10", env: "qemu-ansible-core-2.17" }
29
30
# ansible/libdnf5 bug: https://issues.redhat.com/browse/RHELMISC-10110
30
31
# - { image: "fedora-41", env: "qemu-ansible-core-2.17" }
31
32
- { image: "fedora-42", env: "qemu-ansible-core-2.17" }
33
+
34
+ # container
35
+ - { image: "centos-9", env: "container-ansible-core-2.16" }
36
+ - { image: "centos-9-bootc", env: "container-ansible-core-2.16" }
37
+ # broken on non-running dbus
38
+ # - { image: "centos-10", env: "container-ansible-core-2.17" }
39
+ - { image: "centos-10-bootc", env: "container-ansible-core-2.17" }
40
+ - { image: "fedora-41", env: "container-ansible-core-2.17" }
41
+ - { image: "fedora-42", env: "container-ansible-core-2.17" }
42
+ - { image: "fedora-41-bootc", env: "container-ansible-core-2.17" }
43
+ - { image: "fedora-42-bootc", env: "container-ansible-core-2.17" }
44
+
45
+ env :
46
+ TOX_ARGS : " --skip-tags tests::infiniband,tests::nvme,tests::scsi"
47
+
32
48
steps :
33
49
- name : Checkout repo
34
50
uses : actions/checkout@v4
38
54
run : |
39
55
set -euxo pipefail
40
56
image="${{ matrix.scenario.image }}"
57
+ image="${image%-bootc}"
41
58
42
59
# convert image to tag formats
43
60
platform=
51
68
supported=true
52
69
fi
53
70
71
+ # bootc build support (in buildah) has a separate flag
72
+ if [ "${{ matrix.scenario.image }}" != "$image" ]; then
73
+ if ! yq -e '.galaxy_info.galaxy_tags[] | select(. == "containerbuild")' meta/main.yml; then
74
+ supported=
75
+ fi
76
+ else
77
+ # roles need to opt into support for running in a system container
78
+ env="${{ matrix.scenario.env }}"
79
+ if [ "${env#container}" != "$env" ] &&
80
+ ! yq -e '.galaxy_info.galaxy_tags[] | select(. == "container")' meta/main.yml; then
81
+ supported=
82
+ fi
83
+ fi
84
+
54
85
echo "supported=$supported" >> "$GITHUB_OUTPUT"
55
86
56
87
- name : Set up /dev/kvm
@@ -74,22 +105,22 @@ jobs:
74
105
python3 -m pip install --upgrade pip
75
106
sudo apt update
76
107
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
77
- pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6 .0"
108
+ pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8 .0"
78
109
79
110
- name : Configure tox-lsr
80
111
if : steps.check_platform.outputs.supported
81
112
run : >-
82
113
curl -o ~/.config/linux-system-roles.json
83
114
https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
84
115
85
- - name : Run qemu/kvm tox integration tests
86
- if : steps.check_platform.outputs.supported
116
+ - name : Run qemu integration tests
117
+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
87
118
run : >-
88
119
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
89
120
--log-level=debug --skip-tags tests::infiniband,tests::nvme,tests::scsi --
90
121
91
- - name : Test result summary
92
- if : steps.check_platform.outputs.supported && always()
122
+ - name : Qemu result summary
123
+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu') && always()
93
124
run : |
94
125
set -euo pipefail
95
126
# some platforms may have setup/cleanup playbooks - need to find the
@@ -109,6 +140,24 @@ jobs:
109
140
echo "$f"
110
141
done < batch.report
111
142
143
+ - name : Run container tox integration tests
144
+ if : steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'container')
145
+ run : |
146
+ set -euo pipefail
147
+ # HACK: debug.py/profile.py setup is broken
148
+ export LSR_CONTAINER_PROFILE=false
149
+ export LSR_CONTAINER_PRETTY=false
150
+ rc=0
151
+ for t in tests/tests_*.yml; do
152
+ if tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} $t > ${t}.log 2>&1; then
153
+ echo "PASS: $(basename $t)"
154
+ else
155
+ echo "FAIL: $(basename $t)"
156
+ rc=1
157
+ fi
158
+ done
159
+ exit $rc
160
+
112
161
- name : Upload test logs on failure
113
162
if : failure()
114
163
uses : actions/upload-artifact@v4
@@ -127,7 +176,7 @@ jobs:
127
176
run : |
128
177
set -euo pipefail
129
178
for f in tests/*.log; do
130
- if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then
179
+ if FAIL=$(grep -E - B100 -A30 "fatal:|An exception occurred " "$f"); then
131
180
echo "::group::$(basename $f)"
132
181
echo "$FAIL"
133
182
echo "::endgroup::"
@@ -139,6 +188,6 @@ jobs:
139
188
uses : myrotvorets/set-commit-status-action@master
140
189
with :
141
190
status : success
142
- context : " ${{ github.workflow }} / qemu_kvm (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
191
+ context : " ${{ github.workflow }} / scenario (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
143
192
description : The role does not support this platform. Skipping.
144
193
targetUrl : " "
0 commit comments