Skip to content

CI: Check for whitespace errors #1640

CI: Check for whitespace errors

CI: Check for whitespace errors #1640

name: mkosi boot (mainline)
on:
push:
pull_request:
schedule:
- cron: '0 10 * * *'
jobs:
mkosi-mainline:
if: ${{ github.repository == 'lkrg-org/lkrg' || github.event_name != 'schedule' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update
- run: sudo apt-get install -y debootstrap qemu-system-x86 systemd-container expect sysvbanner
- 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 sed -i 's/dpkg-reconfigure dracut/&||:/' /usr/local/lib/python*/dist-packages/mkosi/resources/dpkg-reconfigure-dracut.install
sudo rm -f /dev/kvm
echo /usr/local/bin >> $GITHUB_PATH
- name: Install debootstrap from Ubuntu git
run: |
sudo git clone --depth 1 https://git.launchpad.net/ubuntu/+source/debootstrap /debootstrap
sudo chmod a+x /debootstrap/debootstrap
sudo ln -s /debootstrap/debootstrap -t /usr/local/bin
- name: Download mainline kernel from Kernel PPA
run: .github/workflows/ubuntu-kernel-daily.sh
- name: Enable LKRG debugging options
run: |
sed -i '/P_LKRG_JUMP_LABEL_STEXT_DEBUG/s/\/\///' src/modules/print_log/p_lkrg_print_log.h
git diff
- name: Create bootable image using mkosi
run: sudo mkosi -r ${{ env.series }} --cache=mkosi.cache --prepare-script=.github/workflows/dpkg-i.sh
- 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' boot.log
grep 'reboot: Power down' boot.log
# vim: sw=4