Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Run fedora and ubuntu uki tests #2366

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 73 additions & 2 deletions .github/workflows/uki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,78 @@ jobs:
docker push "$IMAGE$SUFFIX"
image_ref=$(docker image inspect --format='{{index .RepoDigests 0}}' "$IMAGE$SUFFIX")
cosign sign $image_ref
test-uki:
test-uki-ubuntu:
runs-on: kvm
env:
FLAVOR: ubuntu
FLAVOR_RELEASE: 23.10
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: tests/go.mod
cache-dependency-path: tests/go.sum
- name: Enable KVM group perms
run: |
sudo apt-get update
sudo apt-get install -y libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu qemu-system-x86 qemu-system-x86 qemu-utils qemu-kvm acl udev
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger --name-match=kvm
# sudo usermod -a -G kvm,libvirt $USER
#
# TODO: Switch back to the above solution when we switch to the github runners
# https://askubuntu.com/a/1081326
sudo setfacl -m u:runner:rwx /dev/kvm
- name: Install earthly
uses: Luet-lab/luet-install-action@v1.1
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Build base image 🔧
run: | # known flavors to work with uki+encryption: fedora >= 38, ubuntu >= 23.10, anything with systemd 253
earthly +base-image \
--FLAVOR=ubuntu \
--FLAVOR_RELEASE=23.10 \
--FAMILY=ubuntu \
--MODEL=generic \
--VARIANT=core \
--BASE_IMAGE=ubuntu:23.10
- name: Push image to ttl.sh
env:
TEMP_IMAGE: ttl.sh/ubuntu-2310-${{ github.head_ref || github.ref }}:24h
run: |
docker tag $(cat build/IMAGE) $TEMP_IMAGE
docker push $TEMP_IMAGE
- name: Build uki ISO 🔧
run: |
earthly +uki-iso --BASE_IMAGE=ttl.sh/ubuntu-2310-${{ github.head_ref || github.ref }}:24h
- name: Create datasource iso 🔧
run: |
earthly +datasource-iso --CLOUD_CONFIG=tests/assets/autoinstall.yaml
- name: Run tests 🔧
env:
USE_QEMU: true
KVM: true
MEMORY: 4000
CPUS: 2
FIRMWARE: /usr/share/OVMF/OVMF_CODE.fd
EMULATE_TPM: true
UKI_TEST: true
run: |
export ISO=$(ls $PWD/build/kairos_*.iso)
export DATASOURCE=${PWD}/build/datasource.iso
cp tests/go.* .
go run github.com/onsi/ginkgo/v2/ginkgo -v --label-filter "uki" --fail-fast -r ./tests/
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ env.FLAVOR }}-${{ env.FLAVOR_RELEASE }}.logs.zip
path: tests/**/logs/*
if-no-files-found: warn
test-uki-fedora:
runs-on: kvm
env:
FLAVOR: fedora
Expand Down Expand Up @@ -183,4 +254,4 @@ jobs:
with:
name: ${{ env.FLAVOR }}-${{ env.FLAVOR_RELEASE }}.logs.zip
path: tests/**/logs/*
if-no-files-found: warn
if-no-files-found: warn
Loading