3 # SPDX-License-Identifier: LGPL-2.1-or-later
4 # Simple boot tests that build and boot the mkosi images generated by the mkosi config files in mkosi.conf.d/.
21 - '!shell-completion/**'
39 - '!shell-completion/**'
51 group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
52 cancel-in-progress: true
75 SYSTEMD_LOG_LEVEL: debug
78 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
79 - uses: systemd/mkosi@dbce89aabda438ba58080366631b2c242e365f21
83 tee mkosi.local.conf <<EOF
85 Distribution=${{ matrix.distro }}
86 Release=${{ matrix.release }}
89 # Build a disk image in CI as this logic is much more prone to breakage.
93 Environment=CI_BUILD=1
98 ToolsTreeDistribution=fedora
100 # Sometimes we run on a host with /dev/kvm, but it is broken, so explicitly disable it
105 # These should override the options from mkosi.conf so we put them in a dropin that's ordered later
107 tee mkosi.conf.d/99-ci.conf <<EOF
109 KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
110 systemd.journald.max_level_console=debug
111 # udev's debug log output is very verbose, so up it to info in CI.
113 # Root device can take a long time to appear, so let's bump the timeout.
114 systemd.default_device_timeout_sec=180
117 # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
118 # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
120 mkdir -p mkosi.images/system/mkosi.repart/10-usr.conf.d
121 tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<EOF
126 # The emergency shell is not useful in the CI, as it just blocks for a long time before the job
127 # eventually times out. Override it to just shutdown immediately.
128 mkdir -p mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
129 mkdir -p mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
130 tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<EOF
138 cp mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf
140 - name: Generate secure boot key
141 run: mkosi --debug genkey
143 - name: Show image summary
149 - name: Boot systemd-nspawn
150 run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
153 run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123