Skip to content

CI: Update workflows to use latest versions of the actions #354

CI: Update workflows to use latest versions of the actions

CI: Update workflows to use latest versions of the actions #354

Workflow file for this run

name: mkosi boot (ubuntu)
on: [push, pull_request]
jobs:
mkosi-boot:
runs-on: ubuntu-22.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
- name: Install mkosi from git
# Native focal package seems to be too old (v5) and not even
# able to build images properly.
run: |
sudo python3 -m pip install git+https://github.com/systemd/mkosi.git@v14
sudo sed -i 's/linux-generic/linux-virtual/' /usr/local/lib/python*/dist-packages/mkosi/__init__.py
sudo rm -f /dev/kvm
echo /usr/local/bin >> $GITHUB_PATH
- name: Create bootable image using mkosi
run: sudo 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