]> git.ipfire.org Git - thirdparty/systemd.git/blob - .github/workflows/mkosi.yml
build(deps): bump systemd/mkosi
[thirdparty/systemd.git] / .github / workflows / mkosi.yml
1 ---
2 # vi: ts=2 sw=2 et:
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/.
5 name: mkosi
6
7 on:
8 push:
9 branches:
10 - main
11 - v[0-9]+-stable
12 paths:
13 - '**'
14 - '!README*'
15 - '!LICENSE*'
16 - '!LICENSES/**'
17 - '!TODO'
18 - '!docs/**'
19 - '!man/**'
20 - '!catalog/**'
21 - '!shell-completion/**'
22 - '!po/**'
23 - '!.**'
24 - '.github/**'
25
26 pull_request:
27 branches:
28 - main
29 - v[0-9]+-stable
30 paths:
31 - '**'
32 - '!README*'
33 - '!LICENSE*'
34 - '!LICENSES/**'
35 - '!TODO'
36 - '!docs/**'
37 - '!man/**'
38 - '!catalog/**'
39 - '!shell-completion/**'
40 - '!po/**'
41 - '!.**'
42 - '.github/**'
43
44 permissions:
45 contents: read
46
47 jobs:
48 ci:
49 runs-on: ubuntu-22.04
50 concurrency:
51 group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
52 cancel-in-progress: true
53 strategy:
54 fail-fast: false
55 matrix:
56 include:
57 - distro: arch
58 release: rolling
59 - distro: debian
60 release: testing
61 - distro: ubuntu
62 release: jammy
63 - distro: fedora
64 release: "39"
65 - distro: fedora
66 release: rawhide
67 - distro: opensuse
68 release: tumbleweed
69 - distro: centos
70 release: "9"
71 - distro: centos
72 release: "8"
73
74 env:
75 SYSTEMD_LOG_LEVEL: debug
76
77 steps:
78 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
79 - uses: systemd/mkosi@a8ecff0defa132d729dcdab38380dcae31138e7e
80
81 - name: Configure
82 run: |
83 tee mkosi.conf <<- EOF
84 [Distribution]
85 Distribution=${{ matrix.distro }}
86 Release=${{ matrix.release }}
87 EOF
88
89 tee mkosi.conf.d/99-ci.conf <<- EOF
90 [Content]
91 Environment=CI_BUILD=1
92 SLOW_TESTS=true
93
94 [Host]
95 KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service
96 systemd.journald.max_level_console=debug
97 # udev's debug log output is very verbose, so up it to info in CI.
98 udev.log_level=info
99 # Root device can take a long time to appear, so let's bump the timeout.
100 systemd.default_device_timeout_sec=180
101 QemuVsock=yes
102 Ephemeral=yes
103 EOF
104
105 # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel
106 # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead.
107
108 mkdir -p mkosi.presets/system/mkosi.repart/10-usr.conf.d
109 tee mkosi.presets/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<- EOF
110 [Partition]
111 Format=squashfs
112 EOF
113
114 # The emergency shell is not useful in the CI, as it just blocks for a long time before the job
115 # eventually times out. Override it to just shutdown immediately.
116 mkdir -p mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
117 mkdir -p mkosi.presets/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/
118 tee mkosi.presets/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<- EOF
119 [Unit]
120 FailureAction=exit
121 [Service]
122 ExecStartPre=
123 ExecStart=
124 ExecStart=false
125 EOF
126 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
127
128 - name: Generate secure boot key
129 run: mkosi --debug genkey
130
131 - name: Show image summary
132 run: mkosi summary
133
134 - name: Build
135 run: mkosi --debug
136
137 - name: Boot systemd-nspawn
138 run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123
139
140 - name: Boot QEMU
141 run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123