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
73 SYSTEMD_LOG_LEVEL: debug
76 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
77 - uses: systemd/mkosi@31af101620fc2996517d87e86da310f7ba553d58
79 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
80 # immediately, we remove the files in the background. However, we first move them to a different location
81 # so that nothing tries to use anything in these directories anymore while we're busy deleting them.
82 - name: Free disk space
84 sudo mv /usr/local /usr/local.trash
85 sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash
86 sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash
90 tee mkosi.local.conf <<EOF
92 Distribution=${{ matrix.distro }}
93 Release=${{ matrix.release }}
96 # Build a disk image in CI as this logic is much more prone to breakage.
101 ToolsTreeDistribution=fedora
103 # Sometimes we run on a host with /dev/kvm, but it is broken, so explicitly disable it
105 # TODO: Drop once https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2038777 is fixed in Github Actions
110 # These should override the options from mkosi.conf so we put them in a dropin that's ordered later
112 tee mkosi.conf.d/99-ci.conf <<EOF
114 KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
115 systemd.journald.max_level_console=debug
116 # udev's debug log output is very verbose, so up it to info in CI.
118 # Root device can take a long time to appear, so let's bump the timeout.
119 systemd.default_device_timeout_sec=180
122 # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
123 # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
125 mkdir -p mkosi.images/system/mkosi.repart/10-usr.conf.d
126 tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<EOF
131 # The emergency shell is not useful in the CI, as it just blocks for a long time before the job
132 # eventually times out. Override it to just shutdown immediately.
133 mkdir -p mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
134 mkdir -p mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
135 tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<EOF
143 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
145 - name: Generate secure boot key
146 run: mkosi --debug genkey
148 - name: Show image summary
154 - name: Boot systemd-nspawn
155 run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
158 run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123