1
- name : bootc integration test
1
+ # This workflow builds a container across a matrix of OSes,
2
+ # generates a disk image from that, and runs integration tests
3
+ # using tmt + libvirt (using nested virt support in the default GHA runners).
4
+ name : Build+TMT
2
5
on :
3
6
pull_request :
4
- branches : [main]
7
+ branches : [main]
8
+ workflow_dispatch :
9
+
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress : true
5
13
6
14
jobs :
7
15
build :
8
16
strategy :
17
+ fail-fast : false
9
18
matrix :
10
- test_os : [fedora-41, fedora-42, fedora-43, centos-9]
11
- test_runner : [ubuntu-latest, ubuntu-24.04-arm]
19
+ test_os : [fedora-42, fedora-43, centos-9, centos-10]
12
20
13
- runs-on : ${{ matrix.test_runner }}
21
+ runs-on : ubuntu-24.04
14
22
15
23
steps :
16
- - name : Install podman for heredoc support
24
+ - name : Install dependencies
17
25
run : |
18
26
set -eux
19
27
echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
20
28
sudo apt update
21
- sudo apt install -y crun/testing podman/testing
29
+ sudo apt install -y crun/testing podman/testing just qemu-utils
22
30
23
31
- uses : actions/checkout@v4
24
32
25
- - name : Build bootc and bootc image
26
- env :
27
- TEST_OS : ${{ matrix.test_os }}
28
- run : sudo -E TEST_OS=$TEST_OS tests/build.sh
33
+ - name : Set architecture variable
34
+ id : set_arch
35
+ run : echo "ARCH=$(arch)" >> $GITHUB_ENV
29
36
30
- - name : Grant sudo user permission to archive files
37
+ - name : Build container and disk image
31
38
run : |
32
- sudo chmod 0755 /tmp/tmp-bootc-build/id_rsa
33
-
34
- - name : Archive bootc disk image - disk.raw
35
- if : matrix.test_runner == 'ubuntu-latest'
36
- uses : actions/upload-artifact@v4
37
- with :
38
- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-disk
39
- path : /tmp/tmp-bootc-build/disk.raw
40
- retention-days : 1
39
+ sudo tests/build.sh ${{ matrix.test_os }}
41
40
42
- - name : Archive SSH private key - id_rsa
43
- if : matrix.test_runner == 'ubuntu-latest'
41
+ - name : Archive disk image
44
42
uses : actions/upload-artifact@v4
45
43
with :
46
- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-id_rsa
47
- path : /tmp/tmp- bootc-build/id_rsa
44
+ name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
45
+ path : target/ bootc-integration-test.qcow2
48
46
retention-days : 1
49
47
50
48
test :
51
49
needs : build
52
50
strategy :
51
+ fail-fast : false
53
52
matrix :
54
- test_os : [fedora-41, fedora-42, fedora-43, centos-9]
55
- tmt_plan : [test-01-readonly, test-20-local-upgrade, test-21-logically-bound-switch, test-22-logically-bound-install, test-23-install-outside-container, test-24-local-upgrade-reboot]
53
+ test_os : [fedora-42, fedora-43, centos-9, centos-10]
56
54
57
55
runs-on : ubuntu-latest
58
56
59
57
steps :
60
58
- uses : actions/checkout@v4
61
59
62
- - name : Install dependence
60
+ - name : Set architecture variable
61
+ id : set_arch
62
+ run : echo "ARCH=$(arch)" >> $GITHUB_ENV
63
+
64
+ - name : Install deps
63
65
run : |
64
66
sudo apt-get update
65
- sudo apt install -y qemu-kvm qemu-system
66
- pip install --user tmt
67
+ # see https://tmt.readthedocs.io/en/stable/overview.html#install
68
+ sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system
69
+ pip install --user "tmt[provision-virtual]"
67
70
68
71
- name : Create folder to save disk image
69
- run : mkdir -p /tmp/tmp-bootc-build
72
+ run : mkdir -p target
70
73
71
74
- name : Download disk.raw
72
75
uses : actions/download-artifact@v4
73
76
with :
74
- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-disk
75
- path : /tmp/tmp-bootc-build
76
-
77
- - name : Download id_rsa
78
- uses : actions/download-artifact@v4
79
- with :
80
- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-id_rsa
81
- path : /tmp/tmp-bootc-build
77
+ name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
78
+ path : target
82
79
83
80
- name : Enable KVM group perms
84
81
run : |
@@ -87,14 +84,16 @@ jobs:
87
84
sudo udevadm trigger --name-match=kvm
88
85
ls -l /dev/kvm
89
86
87
+ - name : Workaround https://github.com/teemtee/testcloud/issues/18
88
+ run : sudo rm -f /usr/bin/chcon && sudo ln -sr /usr/bin/true /usr/bin/chcon
89
+
90
90
- name : Run test
91
- env :
92
- TMT_PLAN_NAME : ${{ matrix.tmt_plan }}
93
- run : chmod 600 /tmp/tmp-bootc-build/id_rsa && tests/test.sh
91
+ run : |
92
+ tests/run-tmt.sh
94
93
95
94
- name : Archive TMT logs
96
95
if : always()
97
96
uses : actions/upload-artifact@v4
98
97
with :
99
- name : tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ matrix.tmt_plan }}
98
+ name : tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-${{ matrix.tmt_plan }}
100
99
path : /var/tmp/tmt
0 commit comments