-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Itxaka <[email protected]>
- Loading branch information
Showing
5 changed files
with
124 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Reusable workflow - install test target | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
flavor: | ||
required: true | ||
type: string | ||
flavor_release: | ||
required: true | ||
type: string | ||
secureboot: | ||
required: false | ||
type: boolean | ||
|
||
permissions: read-all | ||
jobs: | ||
test: | ||
runs-on: kvm | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- run: | | ||
git fetch --prune --unshallow | ||
- name: Download ISO | ||
id: iso | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: kairos-${{ inputs.flavor }}-${{ inputs.flavor_release}}.iso.zip | ||
- name: Install Go | ||
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 | ||
with: | ||
go-version-file: tests/go.mod | ||
cache-dependency-path: tests/go.sum | ||
- name: Block all traffic to metadata ip # For cloud runners, the metadata ip can interact with our test machines | ||
run: | | ||
sudo iptables -I INPUT -s 169.254.169.254 -j DROP | ||
sudo iptables -I OUTPUT -d 169.254.169.254 -j DROP | ||
- 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: Tests | ||
env: | ||
USE_QEMU: true | ||
KVM: true | ||
MEMORY: 4000 | ||
CPUS: 2 | ||
DRIVE_SIZE: 30000 | ||
CREATE_VM: true | ||
FLAVOR: ${{ inputs.flavor }} | ||
run: | | ||
if [ "${{ inputs.secureboot }}" = "true" ]; then | ||
export FIRMWARE=/usr/share/OVMF/OVMF_CODE.fd | ||
fi | ||
ls *.iso | ||
export ISO=$PWD/$(ls *.iso) | ||
echo "ISO is: $ISO" | ||
cp tests/go.* . | ||
go run github.com/onsi/ginkgo/v2/ginkgo -v --label-filter "install-test-target" --fail-fast -r ./tests | ||
- uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4 | ||
if: failure() | ||
with: | ||
name: ${{ inputs.flavor }}.logs.zip | ||
path: tests/**/logs/* | ||
if-no-files-found: warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters