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:
12
.github/actions/bootc-ubuntu-setup/action.yml
vendored
12
.github/actions/bootc-ubuntu-setup/action.yml
vendored
@@ -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
|
||||
|
||||
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user