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
25on :
36 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
513
614jobs :
715 build :
816 strategy :
17+ fail-fast : false
918 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]
1220
13- runs-on : ${{ matrix.test_runner }}
21+ runs-on : ubuntu-24.04
1422
1523 steps :
16- - name : Install podman for heredoc support
24+ - name : Install dependencies
1725 run : |
1826 set -eux
1927 echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
2028 sudo apt update
21- sudo apt install -y crun/testing podman/testing
29+ sudo apt install -y crun/testing podman/testing just qemu-utils
2230
2331 - uses : actions/checkout@v4
2432
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
2936
30- - name : Grant sudo user permission to archive files
37+ - name : Build container and disk image
3138 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 }}
4140
42- - name : Archive SSH private key - id_rsa
43- if : matrix.test_runner == 'ubuntu-latest'
41+ - name : Archive disk image
4442 uses : actions/upload-artifact@v4
4543 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
4846 retention-days : 1
4947
5048 test :
5149 needs : build
5250 strategy :
51+ fail-fast : false
5352 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]
5654
5755 runs-on : ubuntu-latest
5856
5957 steps :
6058 - uses : actions/checkout@v4
6159
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
6365 run : |
6466 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]"
6770
6871 - name : Create folder to save disk image
69- run : mkdir -p /tmp/tmp-bootc-build
72+ run : mkdir -p target
7073
7174 - name : Download disk.raw
7275 uses : actions/download-artifact@v4
7376 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
8279
8380 - name : Enable KVM group perms
8481 run : |
@@ -87,14 +84,16 @@ jobs:
8784 sudo udevadm trigger --name-match=kvm
8885 ls -l /dev/kvm
8986
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+
9090 - 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
9493
9594 - name : Archive TMT logs
9695 if : always()
9796 uses : actions/upload-artifact@v4
9897 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 }}
10099 path : /var/tmp/tmt
0 commit comments