Skip to content

Commit 563b7a0

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 f8ba107 commit 563b7a0

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ jobs:
130130
- uses: actions/checkout@v4
131131
- name: Bootc Ubuntu Setup
132132
uses: ./.github/actions/bootc-ubuntu-setup
133-
- name: Install qemu-utils
134-
run: sudo apt install -y qemu-utils
133+
with:
134+
libvirt: true
135135

136136
- name: Build container and disk image
137137
run: |
@@ -162,12 +162,10 @@ jobs:
162162
- uses: actions/checkout@v4
163163
- name: Bootc Ubuntu Setup
164164
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]"
165+
with:
166+
libvirt: true
167+
- name: Install tmt
168+
run: pip install --user "tmt[provision-virtual]"
171169

172170
- name: Create folder to save disk image
173171
run: mkdir -p target

0 commit comments

Comments
 (0)