Skip to content

Commit

Permalink
ci: actually test running a VM
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Jul 4, 2024
1 parent 083ee16 commit 0c7e844
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/test-build-quickemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
runs-on: ubuntu-22.04
permissions:
id-token: "write"
contents: "read"
contents: write
actions: read
checks: write
steps:
- name: "Checkout 🥡"
uses: "actions/checkout@v4"
Expand All @@ -62,4 +64,33 @@ jobs:
tree ./result
./result/bin/quickemu --help
./result/bin/quickget --help
./result/bin/quickreport
# Text a VM if the Nix Installer successfully enabled KVM
if [ $DETERMINATE_NIX_KVM -eq 1 ]; then
./result/bin/quickget alpine v3.20
./result/bin/quickemu --vm alpine-v3.20.conf --display none
sleep 5
if pgrep -F ./alpine-v3.20/alpine-v3.20.pid; then
echo "Test VM is running"
echo "Waiting a few seconds before capturing a screenshot"
sleep 5
./result/bin/quickemu --vm alpine-v3.20.conf --monitor-cmd "screendump test.ppm"
nix shell nixpkgs#imagemagick -c magick convert test.ppm test.png
else
echo "Test VM is not running"
exit 1
fi
# Test a few more quickemu commands to clean up
./result/bin/quickemu --vm alpine-v3.20.conf --kill
./result/bin/quickemu --vm alpine-v3.20.conf --delete-disk
./result/bin/quickemu --vm alpine-v3.20.conf --delete-vm
fi
- name: Upload test results 📸
if: ${{ success() }}
uses: edunad/[email protected]
with:
path: './test.png'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: 'Screenshot of test VM'


0 comments on commit 0c7e844

Please sign in to comment.