Skip to content

Commit fe009f7

Browse files
committed
ci: Consolidate and cleanup workflows
- Having separate workflows made sharing build artifacts not really possible, and it just makes sense to consolidate - Refactor shared parts into a little internal action Signed-off-by: Colin Walters <[email protected]>
1 parent 78f3439 commit fe009f7

File tree

4 files changed

+128
-140
lines changed

4 files changed

+128
-140
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: 'Bootc Ubuntu Setup'
2+
description: 'Default host setup (update podman, install just, clean disk space)'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Update podman and install just
7+
shell: bash
8+
run: |
9+
set -eux
10+
echo 'deb http://azure.archive.ubuntu.com/ubuntu plucky universe main' | sudo tee /etc/apt/sources.list.d/plucky.list
11+
sudo apt update
12+
sudo apt install -y crun/testing podman/testing skopeo/testing just
13+
- name: Free up disk space on runner
14+
shell: bash
15+
run: sudo ./ci/clean-gha-runner.sh

.github/workflows/ci.yml

Lines changed: 112 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
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.
18
name: CI
29

310
permissions:
@@ -18,60 +25,43 @@ concurrency:
1825
cancel-in-progress: true
1926

2027
jobs:
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,93 @@ 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: Set architecture variable
161+
id: set_arch
162+
run: echo "ARCH=$(arch)" >> $GITHUB_ENV
163+
164+
- name: Build container and disk image
165+
run: |
166+
sudo tests/build.sh ${{ matrix.test_os }}
167+
168+
- name: Run container tests
169+
run:
170+
sudo just test-container
171+
172+
- name: Archive disk image
173+
uses: actions/upload-artifact@v4
174+
with:
175+
name: PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
176+
path: target/bootc-integration-test.qcow2
177+
retention-days: 1
178+
179+
# Run TMT-based integration tests on disk images from build-integration
180+
test-integration:
181+
needs: build-integration
182+
strategy:
183+
fail-fast: false
184+
matrix:
185+
test_os: [fedora-42, fedora-43, centos-9, centos-10]
186+
187+
runs-on: ubuntu-24.04
188+
189+
steps:
190+
- uses: actions/checkout@v4
191+
- name: Bootc Ubuntu Setup
192+
uses: ./.github/actions/bootc-ubuntu-setup
193+
194+
- name: Set architecture variable
195+
id: set_arch
196+
run: echo "ARCH=$(arch)" >> $GITHUB_ENV
197+
198+
- name: Install deps
199+
run: |
200+
sudo apt-get update
201+
# see https://tmt.readthedocs.io/en/stable/overview.html#install
202+
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just
203+
pip install --user "tmt[provision-virtual]"
204+
205+
- name: Create folder to save disk image
206+
run: mkdir -p target
207+
208+
- name: Download disk.raw
209+
uses: actions/download-artifact@v4
210+
with:
211+
name: PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-disk
212+
path: target
213+
214+
- name: Enable KVM group perms
215+
run: |
216+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
217+
sudo udevadm control --reload-rules
218+
sudo udevadm trigger --name-match=kvm
219+
ls -l /dev/kvm
220+
221+
- name: Workaround https://github.com/teemtee/testcloud/issues/18
222+
run: sudo rm -f /usr/bin/chcon && sudo ln -sr /usr/bin/true /usr/bin/chcon
223+
224+
- name: Run all TMT tests
225+
run: |
226+
just test-tmt-nobuild
227+
228+
- name: Archive TMT logs
229+
if: always()
230+
uses: actions/upload-artifact@v4
231+
with:
232+
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-${{ matrix.tmt_plan }}
233+
path: /var/tmp/tmt

.github/workflows/integration.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.

ci/clean-gha-runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ apt-get remove -y '^dotnet-.*' > /dev/null
88
apt-get remove -y '^llvm-.*' > /dev/null
99
apt-get remove -y 'php.*' > /dev/null
1010
apt-get remove -y '^mongodb-.*' > /dev/null
11-
apt-get remove -y '^mysql-.*' > /dev/null1
11+
apt-get remove -y '^mysql-.*' > /dev/null
1212
apt-get remove -y azure-cli google-chrome-stable firefox mono-devel >/dev/null
1313
df -h

0 commit comments

Comments
 (0)