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.
1
8
name : CI
2
9
3
10
permissions :
@@ -18,60 +25,43 @@ concurrency:
18
25
cancel-in-progress : true
19
26
20
27
jobs :
21
- # Wrapper for validation
28
+ # Run basic validation checks (linting, formatting, etc)
22
29
validate :
23
30
runs-on : ubuntu-24.04
24
31
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
31
32
- 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
34
35
- name : Validate (default)
35
36
run : just validate
37
+ # Build container with continuous repository enabled
36
38
container-continuous :
37
39
runs-on : ubuntu-24.04
38
40
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
47
41
- 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
50
44
- name : Build with continuous repo enabled
51
45
run : sudo just build --build-arg=continuous_repo=1
46
+ # Check for security vulnerabilities and license compliance
52
47
cargo-deny :
53
- runs-on : ubuntu-latest
48
+ runs-on : ubuntu-24.04
54
49
steps :
55
50
- uses : actions/checkout@v4
56
51
- uses : EmbarkStudios/cargo-deny-action@v2
57
52
with :
58
53
log-level : warn
59
54
command : check -A duplicate bans sources licenses
55
+ # Test bootc installation scenarios and fsverity support
56
+ # TODO convert to be an integration test
60
57
install-tests :
61
58
name : " Test install"
62
- # For a not-ancient podman
63
59
runs-on : ubuntu-24.04
64
60
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
71
61
- name : Checkout repository
72
62
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
75
65
- name : Enable fsverity for /
76
66
run : sudo tune2fs -O verity $(findmnt -vno SOURCE /)
77
67
- name : Install utils
@@ -118,9 +108,11 @@ jobs:
118
108
sudo find /ostree/repo/objects -name '*.file' -type f | while read f; do
119
109
sudo fsverity measure $f >/dev/null
120
110
done
111
+ # Build documentation using mdBook (only for PRs with 'documentation' label)
112
+ # TODO move into Justfile
121
113
docs :
122
114
if : ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
123
- runs-on : ubuntu-latest
115
+ runs-on : ubuntu-24.04
124
116
env :
125
117
MDBOOK_VERSION : 0.4.37
126
118
steps :
@@ -149,3 +141,77 @@ jobs:
149
141
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
150
142
- name : Build with mdBook
151
143
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