Do not try to start VM #26
This file contains hidden or 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
| --- | |
| name: CI | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| integration: | |
| name: Integration Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Override libvirt socket permissions | |
| run: | | |
| sudo install -o root -g root -m 0644 -D .github/workflow-templates/socket-perms.conf /etc/systemd/system/libvirtd.socket.d/socket-perms.conf | |
| - name: Install libvirt | |
| run: >- | |
| sudo apt-get update && | |
| sudo apt-get install --yes | |
| genisoimage | |
| libvirt-clients | |
| libvirt-daemon-system | |
| qemu-kvm | |
| xsltproc | |
| - name: Setup Tofu | |
| uses: opentofu/setup-opentofu@v1 | |
| with: | |
| tofu_version: latest | |
| - name: Permissions workaround | |
| run: | | |
| sudo sed -i -r 's/^#?[[:space:]]*security_driver[[:space:]]*=[^=]+/security_driver = "none"/' /etc/libvirt/qemu.conf | |
| sudo install -o root -g libvirt-qemu -m 0755 -d /var/lib/libvirt/images | |
| virsh -c qemu:///system pool-create-as default dir --target /var/lib/libvirt/images | |
| virsh -c qemu:///system pool-list --all | |
| virsh -c qemu:///system net-list --all | |
| stat /var/run/libvirt/libvirt-sock /var/lib/libvirt/images | |
| - name: Enable KVM group perms | |
| run: | | |
| 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 | |
| - name: Run tofu | |
| run: | | |
| tofu init && | |
| tofu apply -auto-approve; ls -lh /var/lib/libvirt/images |