Skip to content

Commit 898db7d

Browse files
committed
ci: Refactor libvirt setup
Move libvirt installation into a parameterized input in the bootc-ubuntu-setup action, allowing workflows to opt-in via `libvirt: true`. This consolidates installation logic and makes workflows cleaner by removing duplicate package installation steps. Assisted-by: Claude Code Signed-off-by: Colin Walters <[email protected]>
1 parent bb0693c commit 898db7d

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

.github/actions/bootc-ubuntu-setup/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: 'Bootc Ubuntu Setup'
22
description: 'Default host setup'
3+
inputs:
4+
libvirt:
5+
description: 'Install libvirt and virtualization stack'
6+
required: false
7+
default: 'false'
38
runs:
49
using: 'composite'
510
steps:
@@ -55,3 +60,10 @@ runs:
5560
# Suppress actually using the cache for builds running from
5661
# git main so that we avoid incremental compilation bugs
5762
lookup-only: ${{ github.ref == 'refs/heads/main' }}
63+
# Install libvirt stack if requested
64+
- name: Install libvirt and virtualization stack
65+
if: ${{ inputs.libvirt == 'true' }}
66+
shell: bash
67+
run: |
68+
set -eux
69+
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm qemu-utils libvirt-daemon-system

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
sudo podman build -t localhost/bootc-fsverity -f ci/Containerfile.install-fsverity
7777
7878
# TODO move into a container, and then have this tool run other containers
79+
export CARGO_INCREMENTAL=0 # because we aren't caching the test runner bits
7980
cargo build --release -p tests-integration
8081
8182
df -h /
@@ -130,8 +131,8 @@ jobs:
130131
- uses: actions/checkout@v4
131132
- name: Bootc Ubuntu Setup
132133
uses: ./.github/actions/bootc-ubuntu-setup
133-
- name: Install qemu-utils
134-
run: sudo apt install -y qemu-utils
134+
with:
135+
libvirt: true
135136

136137
- name: Build container and disk image
137138
run: |
@@ -162,12 +163,10 @@ jobs:
162163
- uses: actions/checkout@v4
163164
- name: Bootc Ubuntu Setup
164165
uses: ./.github/actions/bootc-ubuntu-setup
165-
- name: Install deps
166-
run: |
167-
sudo apt-get update
168-
# see https://tmt.readthedocs.io/en/stable/overview.html#install
169-
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just
170-
pip install --user "tmt[provision-virtual]"
166+
with:
167+
libvirt: true
168+
- name: Install tmt
169+
run: pip install --user "tmt[provision-virtual]"
171170

172171
- name: Create folder to save disk image
173172
run: mkdir -p target

0 commit comments

Comments
 (0)