]> git.ipfire.org Git - thirdparty/systemd.git/blob - .github/workflows/mkosi.yml
b4d89a7f2471e461aa4b20fa476342e72986b3fe
[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.default.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 env:
48 # Enable debug logging in systemd, but keep udev's log level to info,
49 # since it's _very_ verbose in the QEMU task
50 # Disable the ISC DHCP servers, as they are failing in Ubuntu
51 KERNEL_CMDLINE: "systemd.unit=mkosi-check-and-shutdown.service !quiet systemd.log_level=debug systemd.log_target=console udev.log_level=info systemd.default_standard_output=journal+console systemd.mask=isc-dhcp-server6.service systemd.mask=isc-dhcp-server.service"
52
53 jobs:
54 ci:
55 runs-on: ubuntu-22.04
56 concurrency:
57 group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
58 cancel-in-progress: true
59 strategy:
60 fail-fast: false
61 matrix:
62 include:
63 - distro: arch
64 release: rolling
65 - distro: debian
66 release: testing
67 - distro: ubuntu
68 release: jammy
69 - distro: fedora
70 release: "37"
71 - distro: fedora
72 release: rawhide
73 - distro: opensuse
74 release: tumbleweed
75 - distro: centos
76 release: "9"
77 - distro: centos
78 release: "8"
79
80 steps:
81 - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
82 - uses: systemd/mkosi@1d131062066fe7b5a83b87319b4464b186adbb1c
83
84 - name: Configure
85 run: |
86 tee mkosi.default <<- EOF
87 [Distribution]
88 Distribution=${{ matrix.distro }}
89 Release=${{ matrix.release }}
90 SecureBoot=yes
91
92 [Content]
93 Environment=CI_BUILD=1
94
95 [Output]
96 KernelCommandLine=${{ env.KERNEL_CMDLINE }}
97 EOF
98
99 - name: Generate secure boot key
100 run: mkosi genkey
101
102 - name: Build ${{ matrix.distro }}
103 run: mkosi
104
105 - name: Show ${{ matrix.distro }} image summary
106 run: mkosi summary
107
108 - name: Boot ${{ matrix.distro }} systemd-nspawn
109 run: |
110 STATUS=0
111 sudo strace -f -Z -o strace mkosi boot ${{ env.KERNEL_CMDLINE }} audit=0 || STATUS=$?
112 if [ $STATUS -ne 0 ]; then
113 cat strace
114 fi
115 exit $STATUS
116 env:
117 SYSTEMD_LOG_LEVEL: debug
118
119 - name: Check ${{ matrix.distro }} systemd-nspawn
120 run: |
121 STATUS=0
122 sudo strace -f -Z -o strace mkosi shell bash -c "[[ -e /testok ]] || STATUS=$?"
123 if [ $STATUS -ne 0 ]; then
124 cat /failed-services
125 cat strace
126 fi
127 exit $STATUS
128 env:
129 SYSTEMD_LOG_LEVEL: debug
130
131 - name: Boot ${{ matrix.distro }} QEMU
132 run: timeout -k 30 10m mkosi qemu
133
134 - name: Check ${{ matrix.distro }} QEMU
135 run: |
136 STATUS=0
137 sudo strace -f -Z -o strace mkosi shell bash -c "[[ -e /testok ]] || STATUS=$?"
138 if [ $STATUS -ne 0 ]; then
139 cat /failed-services
140 cat strace
141 fi
142 exit $STATUS
143 env:
144 SYSTEMD_LOG_LEVEL: debug