2021-10-01 13:09:20 +03:00
---
# vi: ts=2 sw=2 et:
2021-10-01 13:10:22 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2023-03-29 11:42:23 +03:00
# Simple boot tests that build and boot the mkosi images generated by the mkosi config files in mkosi.conf.d/.
2020-11-30 23:57:52 +03:00
name : mkosi
on :
push :
branches :
2021-01-21 16:52:18 +03:00
- main
2021-11-12 19:37:15 +03:00
- v[0-9]+-stable
2022-11-10 17:00:53 +03:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 23:57:52 +03:00
pull_request :
branches :
2021-01-21 16:52:18 +03:00
- main
2021-11-12 19:37:15 +03:00
- v[0-9]+-stable
2022-11-10 17:00:53 +03:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 23:57:52 +03:00
2021-11-14 01:34:04 +03:00
permissions :
contents : read
2021-11-13 17:40:20 +03:00
2020-11-30 23:57:52 +03:00
jobs :
ci :
2022-06-21 21:53:42 +03:00
runs-on : ubuntu-22.04
2021-11-10 18:45:12 +03:00
concurrency :
2022-03-07 18:18:42 +03:00
group : ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
2021-11-10 18:45:12 +03:00
cancel-in-progress : true
2020-11-30 23:57:52 +03:00
strategy :
fail-fast : false
matrix :
2022-02-04 14:10:33 +03:00
include :
2023-09-04 14:26:39 +03:00
- distro : arch
release : rolling
2022-02-04 14:10:33 +03:00
- distro : debian
release : testing
- distro : ubuntu
2022-05-21 17:03:14 +03:00
release : jammy
2022-02-04 14:10:33 +03:00
- distro : fedora
2023-04-25 11:14:42 +03:00
release : "38"
2022-07-26 15:53:16 +03:00
- distro : fedora
release : rawhide
2022-02-04 14:10:33 +03:00
- distro : opensuse
release : tumbleweed
2023-01-10 14:04:10 +03:00
- distro : centos
2023-01-24 14:51:31 +03:00
release : "9"
2023-01-29 17:17:06 +03:00
- distro : centos
release : "8"
2020-11-30 23:57:52 +03:00
2023-05-09 21:53:02 +03:00
env :
SYSTEMD_LOG_LEVEL : debug
2020-11-30 23:57:52 +03:00
steps :
2023-09-01 12:22:50 +03:00
- uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
2023-09-09 16:45:41 +03:00
- uses : systemd/mkosi@adaa41512aa30c952daae5ba0abcf2622d66b93b
2020-11-30 23:57:52 +03:00
2021-09-17 12:57:39 +03:00
- name : Configure
2022-02-04 14:10:33 +03:00
run : |
2023-03-29 11:42:23 +03:00
tee mkosi.conf <<- EOF
2022-02-04 14:10:33 +03:00
[ Distribution]
Distribution=${{ matrix.distro }}
Release=${{ matrix.release }}
2023-09-01 14:58:16 +03:00
EOF
2022-02-04 14:10:33 +03:00
2023-09-01 14:58:16 +03:00
tee mkosi.conf.d/99-ci.conf <<- EOF
2022-02-04 14:10:33 +03:00
[ Content]
Environment=CI_BUILD=1
2023-05-06 12:35:38 +03:00
SLOW_TESTS=true
2022-02-04 14:10:33 +03:00
2023-09-01 14:58:16 +03:00
[ Host]
2023-03-16 20:28:14 +03:00
KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
systemd.journald.max_level_console=debug
2023-03-21 12:01:09 +03:00
# udev's debug log output is very verbose, so up it to info in CI.
udev.log_level=info
2023-05-31 17:19:21 +03:00
# Root device can take a long time to appear, so let's bump the timeout.
systemd.default_device_timeout_sec=180
2023-05-27 12:12:22 +03:00
QemuVsock=yes
2023-06-15 18:31:23 +03:00
Ephemeral=yes
2022-02-04 14:10:33 +03:00
EOF
2021-01-03 18:05:06 +03:00
2023-05-08 17:06:41 +03:00
# For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
# version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
2023-08-09 18:17:50 +03:00
mkdir -p mkosi.presets/system/mkosi.repart/10-usr.conf.d
tee mkosi.presets/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<- EOF
2023-05-08 17:06:41 +03:00
[ Partition]
Format=squashfs
EOF
2023-07-26 14:36:40 +03:00
# The emergency shell is not useful in the CI, as it just blocks for a long time before the job
# eventually times out. Override it to just shutdown immediately.
2023-08-09 18:17:50 +03:00
mkdir -p mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
mkdir -p mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
tee mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<- EOF
2023-07-26 14:36:40 +03:00
[ Unit]
FailureAction=exit
[ Service]
ExecStartPre=
ExecStart=
ExecStart=false
EOF
2023-08-09 18:17:50 +03:00
cp mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf
2023-07-26 14:36:40 +03:00
2023-01-31 20:53:28 +03:00
- name : Generate secure boot key
2023-05-09 21:53:02 +03:00
run : mkosi --debug genkey
2023-01-31 20:53:28 +03:00
2023-08-30 20:58:14 +03:00
- name : Show image summary
2023-02-09 11:53:05 +03:00
run : mkosi summary
2021-05-19 22:29:42 +03:00
2023-08-30 20:58:14 +03:00
- name : Build
2023-05-09 21:53:02 +03:00
run : mkosi --debug
2023-04-23 15:53:11 +03:00
2023-08-30 20:58:14 +03:00
- name : Boot systemd-nspawn
2023-06-08 18:50:05 +03:00
run : test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
2021-12-08 21:31:25 +03:00
2023-08-30 20:58:14 +03:00
- name : Boot QEMU
2023-06-08 18:50:05 +03:00
run : timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123