1+ # CI Workflow for bootc
2+ #
3+ # Core principles:
4+ # - Everything done here should be easy to replicate locally. Most tasks
5+ # should invoke `just <something>`.
6+ # - Most additions to this should be extending existing tasks; e.g.
7+ # there's places for unit and integration tests already.
18name : CI
29
310permissions :
@@ -18,60 +25,43 @@ concurrency:
1825 cancel-in-progress : true
1926
2027jobs :
21- # Wrapper for validation
28+ # Run basic validation checks (linting, formatting, etc)
2229 validate :
2330 runs-on : ubuntu-24.04
2431 steps :
25- - name : Get a newer podman for heredoc support (from debian testing)
26- run : |
27- set -eux
28- echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
29- sudo apt update
30- sudo apt install -y crun/testing podman/testing skopeo/testing just
3132 - uses : actions/checkout@v4
32- - name : Free up disk space on runner
33- run : sudo ./ci/clean-gha-runner.sh
33+ - name : Bootc Ubuntu Setup
34+ uses : ./.github/actions/bootc-ubuntu-setup
3435 - name : Validate (default)
3536 run : just validate
37+ # Build container with continuous repository enabled
3638 container-continuous :
3739 runs-on : ubuntu-24.04
3840 steps :
39- - name : Get a newer podman for heredoc support (from debian testing)
40- run : |
41- set -eux
42- echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
43- sudo apt update
44- sudo apt install -y crun/testing podman/testing skopeo/testing just
45- - name : Installdeps
46- run : sudo apt update && sudo apt install just
4741 - uses : actions/checkout@v4
48- - name : Free up disk space on runner
49- run : sudo ./ci/clean-gha-runner.sh
42+ - name : Bootc Ubuntu Setup
43+ uses : ./.github/actions/bootc-ubuntu-setup
5044 - name : Build with continuous repo enabled
5145 run : sudo just build --build-arg=continuous_repo=1
46+ # Check for security vulnerabilities and license compliance
5247 cargo-deny :
53- runs-on : ubuntu-latest
48+ runs-on : ubuntu-24.04
5449 steps :
5550 - uses : actions/checkout@v4
5651 - uses : EmbarkStudios/cargo-deny-action@v2
5752 with :
5853 log-level : warn
5954 command : check -A duplicate bans sources licenses
55+ # Test bootc installation scenarios and fsverity support
56+ # TODO convert to be an integration test
6057 install-tests :
6158 name : " Test install"
62- # For a not-ancient podman
6359 runs-on : ubuntu-24.04
6460 steps :
65- - name : Get a newer podman for heredoc support (from debian testing)
66- run : |
67- set -eux
68- echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
69- sudo apt update
70- sudo apt install -y crun/testing podman/testing skopeo/testing just
7161 - name : Checkout repository
7262 uses : actions/checkout@v4
73- - name : Free up disk space on runner
74- run : sudo ./ci/clean-gha-runner.sh
63+ - name : Bootc Ubuntu Setup
64+ uses : ./.github/actions/bootc-ubuntu-setup
7565 - name : Enable fsverity for /
7666 run : sudo tune2fs -O verity $(findmnt -vno SOURCE /)
7767 - name : Install utils
@@ -118,9 +108,11 @@ jobs:
118108 sudo find /ostree/repo/objects -name '*.file' -type f | while read f; do
119109 sudo fsverity measure $f >/dev/null
120110 done
111+ # Build documentation using mdBook (only for PRs with 'documentation' label)
112+ # TODO move into Justfile
121113 docs :
122114 if : ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
123- runs-on : ubuntu-latest
115+ runs-on : ubuntu-24.04
124116 env :
125117 MDBOOK_VERSION : 0.4.37
126118 steps :
@@ -149,3 +141,77 @@ jobs:
149141 echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
150142 - name : Build with mdBook
151143 run : cd docs && mdbook-mermaid install && mdbook build
144+ # Build containers and disk images for integration testing across OS matrix
145+ build-integration :
146+ strategy :
147+ fail-fast : false
148+ matrix :
149+ test_os : [fedora-42, fedora-43, centos-9, centos-10]
150+
151+ runs-on : ubuntu-24.04
152+
153+ steps :
154+ - uses : actions/checkout@v4
155+ - name : Bootc Ubuntu Setup
156+ uses : ./.github/actions/bootc-ubuntu-setup
157+ - name : Install qemu-utils
158+ run : sudo apt install -y qemu-utils
159+
160+ - name : Build container and disk image
161+ run : |
162+ sudo tests/build.sh ${{ matrix.test_os }}
163+
164+ - name : Run container tests
165+ run :
166+ sudo just test-container
167+
168+ - name : Archive disk image
169+ uses : actions/upload-artifact@v4
170+ with :
171+ name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
172+ path : target/bootc-integration-test.qcow2
173+ retention-days : 1
174+
175+ # Run TMT-based integration tests on disk images from build-integration
176+ test-integration :
177+ needs : build-integration
178+ strategy :
179+ fail-fast : false
180+ matrix :
181+ test_os : [fedora-42, fedora-43, centos-9, centos-10]
182+
183+ runs-on : ubuntu-24.04
184+
185+ steps :
186+ - uses : actions/checkout@v4
187+ - name : Bootc Ubuntu Setup
188+ uses : ./.github/actions/bootc-ubuntu-setup
189+ - name : Install deps
190+ run : |
191+ sudo apt-get update
192+ # see https://tmt.readthedocs.io/en/stable/overview.html#install
193+ sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just
194+ pip install --user "tmt[provision-virtual]"
195+
196+ - name : Create folder to save disk image
197+ run : mkdir -p target
198+
199+ - name : Download disk.raw
200+ uses : actions/download-artifact@v4
201+ with :
202+ name : PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
203+ path : target
204+
205+ - name : Workaround https://github.com/teemtee/testcloud/issues/18
206+ run : sudo rm -f /usr/bin/chcon && sudo ln -sr /usr/bin/true /usr/bin/chcon
207+
208+ - name : Run all TMT tests
209+ run : |
210+ just test-tmt-nobuild
211+
212+ - name : Archive TMT logs
213+ if : always()
214+ uses : actions/upload-artifact@v4
215+ with :
216+ name : tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-${{ matrix.tmt_plan }}
217+ path : /var/tmp/tmt
0 commit comments