@@ -120,8 +120,10 @@ jobs:
120120 uses : ./.github/actions/bootc-ubuntu-setup
121121 - name : Build mdbook
122122 run : just build-mdbook
123- # Build containers and disk images for integration testing across OS matrix
124- build-integration :
123+ # Build bootc from source into a container image FROM each specified base `test_os`
124+ # running unit and integration tests (using TMT, leveraging the support for nested virtualization
125+ # in the GHA runners)
126+ test-integration :
125127 strategy :
126128 fail-fast : false
127129 matrix :
@@ -135,49 +137,43 @@ jobs:
135137 uses : ./.github/actions/bootc-ubuntu-setup
136138 with :
137139 libvirt : true
140+ - name : Install tmt
141+ run : pip install --user "tmt[provision-virtual]"
138142
139143 - name : Build container and disk image
140144 run : |
141- tests/build.sh ${{ matrix.test_os }}
145+ set -xeuo pipefail
146+ build_args=()
147+ # Map from an ID-VERSIONID pair to a container ref
148+ target=${{ matrix.test_os }}
149+ OS_ID=$(echo "$target" | cut -d '-' -f 1)
150+ OS_VERSION_ID=$(echo "$target" | cut -d '-' -f 2)
151+ # Base image
152+ case "$OS_ID" in
153+ "centos")
154+ BASE="quay.io/centos-bootc/centos-bootc:stream${OS_VERSION_ID}"
155+ ;;
156+ "fedora")
157+ BASE="quay.io/fedora/fedora-bootc:${OS_VERSION_ID}"
158+ ;;
159+ *) echo "Unknown OS: ${OS_ID}" 1>&2; exit 1
160+ ;;
161+ esac
162+ build_args+=("--build-arg=base=$BASE")
163+ just build ${build_args[@]}
164+ just build-integration-test-image
165+ # Cross check we're using the right base
166+ used_vid=$(podman run --rm localhost/bootc-integration bash -c '. /usr/lib/os-release && echo $VERSION_ID')
167+ test "$OS_VERSION_ID" = "${used_vid}"
142168
143169 - name : Run container tests
144- run :
170+ run : |
145171 just test-container
146172
147- - name : Archive disk image
148- uses : actions/upload-artifact@v5
149- with :
150- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
151- path : target/bootc-integration-test.qcow2
152- retention-days : 1
153-
154- # Run TMT-based integration tests on disk images from build-integration
155- test-integration :
156- needs : build-integration
157- strategy :
158- fail-fast : false
159- matrix :
160- test_os : [fedora-42, fedora-43, centos-9, centos-10]
161-
162- runs-on : ubuntu-24.04
163-
164- steps :
165- - uses : actions/checkout@v5
166- - name : Bootc Ubuntu Setup
167- uses : ./.github/actions/bootc-ubuntu-setup
168- with :
169- libvirt : true
170- - name : Install tmt
171- run : pip install --user "tmt[provision-virtual]"
172-
173- - name : Create folder to save disk image
174- run : mkdir -p target
175-
176- - name : Download disk.raw
177- uses : actions/download-artifact@v6
178- with :
179- name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
180- path : target
173+ - name : Generate disk image
174+ run : |
175+ mkdir -p target
176+ just build-disk-image localhost/bootc-integration target/bootc-integration-test.qcow2
181177
182178 - name : Workaround https://github.com/teemtee/testcloud/issues/18
183179 run : sudo rm -f /usr/bin/chcon && sudo ln -sr /usr/bin/true /usr/bin/chcon
0 commit comments