1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

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 <walters@verbum.org>
This commit is contained in:
Colin Walters
2025-10-08 17:43:37 -04:00
parent f8ba1079e9
commit 563b7a0315
2 changed files with 18 additions and 8 deletions

View File

@@ -1,5 +1,10 @@
name: 'Bootc Ubuntu Setup'
description: 'Default host setup'
inputs:
libvirt:
description: 'Install libvirt and virtualization stack'
required: false
default: 'false'
runs:
using: 'composite'
steps:
@@ -55,3 +60,10 @@ runs:
# Suppress actually using the cache for builds running from
# git main so that we avoid incremental compilation bugs
lookup-only: ${{ github.ref == 'refs/heads/main' }}
# Install libvirt stack if requested
- name: Install libvirt and virtualization stack
if: ${{ inputs.libvirt == 'true' }}
shell: bash
run: |
set -eux
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm qemu-utils libvirt-daemon-system

View File

@@ -130,8 +130,8 @@ jobs:
- uses: actions/checkout@v4
- name: Bootc Ubuntu Setup
uses: ./.github/actions/bootc-ubuntu-setup
- name: Install qemu-utils
run: sudo apt install -y qemu-utils
with:
libvirt: true
- name: Build container and disk image
run: |
@@ -162,12 +162,10 @@ jobs:
- uses: actions/checkout@v4
- name: Bootc Ubuntu Setup
uses: ./.github/actions/bootc-ubuntu-setup
- name: Install deps
run: |
sudo apt-get update
# see https://tmt.readthedocs.io/en/stable/overview.html#install
sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just
pip install --user "tmt[provision-virtual]"
with:
libvirt: true
- name: Install tmt
run: pip install --user "tmt[provision-virtual]"
- name: Create folder to save disk image
run: mkdir -p target