This action runs integration tests against any bootable container image.
- The image to be tested and the tests to be run are passed in via the action inputs.
- BlueBuild is used to add a thin layer onto the image to ensure ssh, networking, and container policies are configured to allow testing to function. This test image is pushed to the registry using an
integrationtest-UUID
tag. - bootc-image-builder is used to generate a qcow image with preconfigured ssh.
- The resulting qcow image is imported into virt-install.
- Once the machine has booted, tests are executed on the VM and their output is recorded.
- As a cleanup step, the test image is removed from the registry.
- Test output logs are uploaded to Github Artifacts and the action passes if all tests exited with exit code 0.
# .github/workflows/integration-tests.yml
name: integration-tests
permissions: {}
on:
schedule:
- cron: "00 7 * * *" # run at 7:00 UTC every day
jobs:
integration-tests:
name: Run integration tests
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Run integration tests
uses: secureblue/bootc-virtual-machine-action@6638202e094c8f30b06917ccdd3187a1e376cdb9 # v0.0.1
with:
registry: ghcr.io/secureblue
image: silverblue-main-hardened
token: ${{ secrets.GITHUB_TOKEN }}
tests: |
./.github/workflows/integration_tests/test1.sh
./.github/workflows/integration_tests/test2.sh
./.github/workflows/integration_tests/test3.sh
./.github/workflows/integration_tests/test4.sh
Input | Description | Type | Required | Default |
---|---|---|---|---|
registry |
Registry for the image. Example: ghcr.io/secureblue | string | Yes | N/A |
image |
Image name for the VM. Example: silverblue-main-hardened | string | Yes | N/A |
tests |
List of test scripts to execute on the VM via SSH after it boots. | string | Yes | N/A |
token |
Github token | string | Yes | N/A |
vm-name |
Name for the virtual machine and its disk in libvirt. | string | No | vm-bootc |
vcpus |
Number of virtual CPUs for the VM. | number | No | 3 |
memory-mb |
Amount of RAM in MB for the VM. | number | No | 8192 |
disk-size-gb |
Size (in GB) of the virtual machine disk. | number | No | 20 |
startup-wait-seconds |
Time in seconds to wait after VM startup, before running post-install commands. | number | No | 180 |