2021-10-01 12:09:20 +02:00
---
# vi: ts=2 sw=2 et:
2021-10-01 12:10:22 +02:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2023-03-29 10:42:23 +02:00
# Simple boot tests that build and boot the mkosi images generated by the mkosi config files in mkosi.conf.d/.
2020-11-30 20:57:52 +00:00
name : mkosi
on :
push :
branches :
2021-01-21 13:52:18 +00:00
- main
2021-11-12 17:37:15 +01:00
- v[0-9]+-stable
2022-11-10 15:00:53 +01:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 20:57:52 +00:00
pull_request :
branches :
2021-01-21 13:52:18 +00:00
- main
2021-11-12 17:37:15 +01:00
- v[0-9]+-stable
2022-11-10 15:00:53 +01:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 20:57:52 +00:00
2021-11-13 22:34:04 +00:00
permissions :
contents : read
2021-11-13 14:40:20 +00:00
2020-11-30 20:57:52 +00:00
jobs :
ci :
2022-06-21 20:53:42 +02:00
runs-on : ubuntu-22.04
2021-11-10 16:45:12 +01:00
concurrency :
2022-03-07 16:18:42 +01:00
group : ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
2021-11-10 16:45:12 +01:00
cancel-in-progress : true
2020-11-30 20:57:52 +00:00
strategy :
fail-fast : false
matrix :
2022-02-04 11:10:33 +00:00
include :
2023-09-03 14:07:56 +01:00
# Temporarily disabled due to keyring packaging issues
# - distro: arch
# release: rolling
2022-02-04 11:10:33 +00:00
- distro : debian
release : testing
- distro : ubuntu
2022-05-21 16:03:14 +02:00
release : jammy
2022-02-04 11:10:33 +00:00
- distro : fedora
2023-04-25 10:14:42 +02:00
release : "38"
2022-07-26 14:53:16 +02:00
- distro : fedora
release : rawhide
2022-02-04 11:10:33 +00:00
- distro : opensuse
release : tumbleweed
2023-01-10 12:04:10 +01:00
- distro : centos
2023-01-24 12:51:31 +01:00
release : "9"
2023-01-29 15:17:06 +01:00
- distro : centos
release : "8"
2020-11-30 20:57:52 +00:00
2023-05-09 20:53:02 +02:00
env :
SYSTEMD_LOG_LEVEL : debug
2020-11-30 20:57:52 +00:00
steps :
2023-09-01 09:22:50 +00:00
- uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
2023-08-15 10:35:56 +02:00
- uses : systemd/mkosi@0af3f8a35c3be0e54b20234be7ab478d25bcc740
2020-11-30 20:57:52 +00:00
2021-09-17 10:57:39 +01:00
- name : Configure
2022-02-04 11:10:33 +00:00
run : |
2023-03-29 10:42:23 +02:00
tee mkosi.conf <<- EOF
2022-02-04 11:10:33 +00:00
[ Distribution]
Distribution=${{ matrix.distro }}
Release=${{ matrix.release }}
[ Content]
Environment=CI_BUILD=1
2023-05-06 11:35:38 +02:00
SLOW_TESTS=true
2022-02-04 11:10:33 +00:00
[ Output]
2023-03-16 18:28:14 +01:00
KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
systemd.journald.max_level_console=debug
2023-03-21 10:01:09 +01:00
# udev's debug log output is very verbose, so up it to info in CI.
udev.log_level=info
2023-05-31 16:19:21 +02:00
# Root device can take a long time to appear, so let's bump the timeout.
systemd.default_device_timeout_sec=180
2023-04-12 17:27:06 +02:00
[ Host]
ExtraSearchPaths=!*
2023-05-27 11:12:22 +02:00
QemuVsock=yes
2023-06-15 17:31:23 +02:00
Ephemeral=yes
2022-02-04 11:10:33 +00:00
EOF
2021-01-03 16:05:06 +01:00
2023-05-08 16:06:41 +02: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 17:17:50 +02: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 16:06:41 +02:00
[ Partition]
Format=squashfs
EOF
2023-07-26 12:36:40 +01: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 17:17:50 +02: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 12:36:40 +01:00
[ Unit]
FailureAction=exit
[ Service]
ExecStartPre=
ExecStart=
ExecStart=false
EOF
2023-08-09 17:17:50 +02: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 12:36:40 +01:00
2023-01-31 18:53:28 +01:00
- name : Generate secure boot key
2023-05-09 20:53:02 +02:00
run : mkosi --debug genkey
2023-01-31 18:53:28 +01:00
2021-05-19 21:29:42 +02:00
- name : Show ${{ matrix.distro }} image summary
2023-02-09 09:53:05 +01:00
run : mkosi summary
2021-05-19 21:29:42 +02:00
2023-04-23 14:53:11 +02:00
- name : Build ${{ matrix.distro }}
2023-05-09 20:53:02 +02:00
run : mkosi --debug
2023-04-23 14:53:11 +02:00
2020-11-30 20:57:52 +00:00
- name : Boot ${{ matrix.distro }} systemd-nspawn
2023-06-08 17:50:05 +02:00
run : test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
2021-12-08 19:31:25 +01:00
2020-11-30 20:57:52 +00:00
- name : Boot ${{ matrix.distro }} QEMU
2023-06-08 17:50:05 +02:00
run : timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123