]> git.ipfire.org Git - thirdparty/systemd.git/blame - .github/workflows/mkosi.yml
mkosi: Update fedora to latest
[thirdparty/systemd.git] / .github / workflows / mkosi.yml
CommitLineData
43d6fcc0
ZJS
1---
2# vi: ts=2 sw=2 et:
186b9041 3# SPDX-License-Identifier: LGPL-2.1-or-later
94c9855a 4# Simple boot tests that build and boot the mkosi images generated by the mkosi config files in mkosi.conf.d/.
448d3462
DDM
5name: mkosi
6
448d3462
DDM
7on:
8 push:
9 branches:
9b25429c 10 - main
c76a8385 11 - v[0-9]+-stable
976ceafe
ZJS
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
448d3462
DDM
26 pull_request:
27 branches:
9b25429c 28 - main
c76a8385 29 - v[0-9]+-stable
976ceafe
ZJS
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/**'
448d3462 43
e7a96691
EV
44permissions:
45 contents: read
311956cc 46
448d3462
DDM
47jobs:
48 ci:
f304d038 49 runs-on: ubuntu-22.04
38848376 50 concurrency:
3a2f1d19 51 group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
38848376 52 cancel-in-progress: true
448d3462
DDM
53 strategy:
54 fail-fast: false
55 matrix:
24a0df5c 56 include:
16173ab1
DDM
57 - distro: arch
58 release: rolling
24a0df5c
DDM
59 - distro: debian
60 release: testing
61 - distro: ubuntu
4d0f1451 62 release: noble
2d625795
DDM
63 - distro: fedora
64 release: rawhide
c2720fa5
DDM
65 - distro: opensuse
66 release: tumbleweed
9d2e4cee 67 - distro: centos
c8943ce8 68 release: "9"
448d3462
DDM
69
70 steps:
e065f1c4 71 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
23d79a84 72 - uses: systemd/mkosi@55f17a8ae67ece9712324c3107804daad94ad0d9
448d3462 73
e48c170f
DDM
74 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
75 # immediately, we remove the files in the background. However, we first move them to a different location
76 # so that nothing tries to use anything in these directories anymore while we're busy deleting them.
5e39dc2f
LB
77 - name: Free disk space
78 run: |
e48c170f
DDM
79 sudo mv /usr/local /usr/local.trash
80 sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash
81 sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash
5e39dc2f 82
42212407
DDM
83 - name: Btrfs
84 run: |
85 truncate --size=100G btrfs.raw
86 mkfs.btrfs btrfs.raw
87 sudo mkdir /mnt/mkosi
88 LOOP="$(sudo losetup --find --show --direct-io=on btrfs.raw)"
89 sudo mount "$LOOP" /mnt/mkosi --options compress=zstd:1,user_subvol_rm_allowed,noatime,discard=async,space_cache=v2
90 sudo chown "$(id -u):$(id -g)" /mnt/mkosi
91 mkdir /mnt/mkosi/tmp
92 echo "TMPDIR=/mnt/mkosi/tmp" >>"$GITHUB_ENV"
93 ln -s /mnt/mkosi/build build
94
7e99216c 95 - name: Configure
24a0df5c 96 run: |
8c018edb 97 tee mkosi.local.conf <<EOF
24a0df5c
DDM
98 [Distribution]
99 Distribution=${{ matrix.distro }}
100 Release=${{ matrix.release }}
101
52842bb2
DDM
102 [Output]
103 # Build a disk image in CI as this logic is much more prone to breakage.
104 Format=disk
42212407
DDM
105 UseSubvolumes=yes
106
107 WorkspaceDirectory=$TMPDIR
108 PackageCacheDirectory=$TMPDIR/cache
109
110 [Content]
111 Environment=
112 # mkfs.erofs is extremely noisy when not connected to a tty.
113 SYSTEMD_REPART_MKFS_OPTIONS_EROFS="--quiet"
114 # Build debuginfo packages since we'll be publishing the packages as artifacts.
115 WITH_DEBUG=1
116 # Enabling optimizations significantly speeds up integration tests.
117 OPTIMIZATION=g
52842bb2 118
8c018edb
DDM
119 [Host]
120 ToolsTree=default
121 ToolsTreeDistribution=fedora
e399efea
DDM
122 # TODO: Drop once https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2038777 is fixed in Github Actions
123 QemuFirmware=uefi
7681a8ee
DDM
124 # We build with debuginfo so there's no point in mounting the sources into the machine.
125 RuntimeBuildSources=no
8c018edb
DDM
126 EOF
127
128 # These should override the options from mkosi.conf so we put them in a dropin that's ordered later
129 # instead.
130 tee mkosi.conf.d/99-ci.conf <<EOF
35356d7f 131 [Host]
42212407 132 KernelCommandLineExtra=
42212407
DDM
133 # Root device can take a long time to appear, so let's bump the timeout.
134 systemd.default_device_timeout_sec=180
24a0df5c 135 EOF
6242cda9 136
2de6cc18 137 - name: Generate secure boot key
93a94886 138 run: mkosi --debug genkey
2de6cc18 139
bc763971 140 - name: Show image summary
c9853672 141 run: mkosi summary
715a273b 142
42212407
DDM
143 - name: Install build dependencies
144 run: |
145 sudo apt-get install \
146 meson \
147 gperf \
148 libfdisk-dev \
149 libtss2-dev \
150 libblkid-dev \
151 libmicrohttpd-dev \
152 libcap-dev \
153 libcurl4-openssl-dev \
154 libcryptsetup-dev \
155 erofs-utils \
156 dosfstools \
157 python3-pefile \
158 sbsigntool \
159 mtools
160
161 - name: Configure meson
162 run: |
163 meson setup build \
164 --buildtype=debugoptimized \
165 -Dintegration-tests=true \
166 -Dremote=enabled \
167 -Dopenssl=enabled \
168 -Dblkid=enabled \
169 -Dtpm2=enabled \
170 -Dlibcryptsetup=enabled \
171 -Dlibcurl=enabled \
ffda3c3d 172 -Drepart=disabled \
42212407
DDM
173 -Dfirstboot=true \
174 -Dsysusers=true \
175 -Dtmpfiles=true \
176 -Dhwdb=true \
177 -Dvmspawn=enabled
178
179 - name: Build image
180 run: meson compile -C build mkosi
181
182 - name: Run integration tests
eabf46ef 183 run: meson test -C build --no-rebuild --suite integration-tests --print-errorlogs --no-stdsplit --num-processes "$(($(nproc) - 1))"
42212407
DDM
184
185 - name: Archive failed test journals
186 uses: actions/upload-artifact@v4
4becd5fb 187 if: failure() && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable')
42212407
DDM
188 with:
189 name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-failed-test-journals
190 path: |
191 build/test/journal/*.journal
292110aa 192 build/meson-logs/*
17310088 193 retention-days: 7
42212407
DDM
194
195 - name: Archive packages
196 uses: actions/upload-artifact@v4
4becd5fb 197 if: (success() || failure()) && (github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable')
42212407
DDM
198 with:
199 name: ci-mkosi-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.distro }}-${{ matrix.release }}-packages
200 path: |
201 build/mkosi.output/*.rpm
202 build/mkosi.output/*.deb
203 build/mkosi.output/*.ddeb
279b3d46 204 build/mkosi.output/*.pkg.tar
5841b5af 205 retention-days: 4