test-env #92
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
name: mkosi boot (ubuntu) | |
on: [push, pull_request] | |
jobs: | |
mkosi-boot: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
release: | |
- bionic | |
- focal | |
- jammy | |
steps: | |
- uses: actions/checkout@v3 | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y debootstrap qemu-system-x86 systemd-container expect pipx | |
- name: Install mkosi from git | |
# Native focal package seems to be too old (v5) and not even | |
# able to build images properly. | |
run: | | |
set -x | |
sudo -i env || : | |
sudo -s env || : | |
sudo pipx ensurepath | |
sudo -i env || : | |
sudo -s env || : | |
sudo pipx install git+https://github.com/systemd/mkosi.git | |
sudo rm -f /dev/kvm | |
echo /usr/local/bin >> $GITHUB_PATH | |
- name: Create bootable image using mkosi | |
run: sudo -E mkosi -r ${{ matrix.release }} --cache=mkosi.cache | |
- name: Boot image on qemu | |
run: | | |
sudo expect <<- EOF | tr -d '\r' | tee boot.log | |
proc abort {} { send_error "ABORT\n"; exit 1 } | |
spawn mkosi qemu -no-reboot | |
expect "Booting" { send "\r" } | |
set timeout 300 | |
expect "login: " {} default abort | |
set timeout 60 | |
expect "# " { send "/lkrg/.github/workflows/run-boot-tests.sh\r" } default abort | |
expect "# " { send "systemctl poweroff\r" } default abort | |
expect timeout abort eof { exit 0 } | |
EOF | |
shell: bash -eo pipefail {0} | |
- name: Check boot.log for 'LKRG initialized successfully' | |
run: | | |
grep 'Linux version' boot.log | |
grep 'LKRG initialized successfully' boot.log | |
- name: Check that boot.log does not contain problems | |
run: "! grep -E 'Kernel panic|BUG:|WARNING:|ALERT:|FAULT:|FATAL:|Oops|Call Trace' boot.log" | |
- name: Check that boot-tests script finished successfully | |
run: grep 'run-boot-tests.sh - SUCCESS' boot.log | |
- name: Check that boot.log contains shutdown sequence | |
run: | | |
grep 'Reached target.*\(Power.Off\|Shutdown\)' boot.log | |
grep 'reboot: Power down' boot.log | |
# vim: sw=4 |