]>
Commit | Line | Data |
---|---|---|
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 |
5 | name: mkosi |
6 | ||
448d3462 DDM |
7 | on: |
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 |
44 | permissions: |
45 | contents: read | |
311956cc | 46 | |
448d3462 DDM |
47 | jobs: |
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 |
24a0df5c | 63 | - distro: fedora |
755012d3 | 64 | release: "39" |
2d625795 DDM |
65 | - distro: fedora |
66 | release: rawhide | |
c2720fa5 DDM |
67 | - distro: opensuse |
68 | release: tumbleweed | |
9d2e4cee | 69 | - distro: centos |
c8943ce8 | 70 | release: "9" |
448d3462 | 71 | |
93a94886 DDM |
72 | env: |
73 | SYSTEMD_LOG_LEVEL: debug | |
74 | ||
448d3462 | 75 | steps: |
e065f1c4 | 76 | - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 |
962f9d6f | 77 | - uses: systemd/mkosi@5fd70560a1b1ac854b9e1c5a450df311f9000121 |
448d3462 | 78 | |
e48c170f DDM |
79 | # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space |
80 | # immediately, we remove the files in the background. However, we first move them to a different location | |
81 | # so that nothing tries to use anything in these directories anymore while we're busy deleting them. | |
5e39dc2f LB |
82 | - name: Free disk space |
83 | run: | | |
e48c170f DDM |
84 | sudo mv /usr/local /usr/local.trash |
85 | sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash | |
86 | sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash | |
5e39dc2f | 87 | |
7e99216c | 88 | - name: Configure |
24a0df5c | 89 | run: | |
8c018edb | 90 | tee mkosi.local.conf <<EOF |
24a0df5c DDM |
91 | [Distribution] |
92 | Distribution=${{ matrix.distro }} | |
93 | Release=${{ matrix.release }} | |
94 | ||
52842bb2 DDM |
95 | [Output] |
96 | # Build a disk image in CI as this logic is much more prone to breakage. | |
97 | Format=disk | |
98 | ||
8c018edb DDM |
99 | [Host] |
100 | ToolsTree=default | |
101 | ToolsTreeDistribution=fedora | |
102 | QemuVsock=yes | |
103 | # Sometimes we run on a host with /dev/kvm, but it is broken, so explicitly disable it | |
e399efea DDM |
104 | QemuKvm=yes |
105 | # TODO: Drop once https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2038777 is fixed in Github Actions | |
106 | QemuFirmware=uefi | |
8c018edb DDM |
107 | Ephemeral=yes |
108 | EOF | |
109 | ||
110 | # These should override the options from mkosi.conf so we put them in a dropin that's ordered later | |
111 | # instead. | |
112 | tee mkosi.conf.d/99-ci.conf <<EOF | |
35356d7f | 113 | [Host] |
58caedad | 114 | KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service |
8630fb60 | 115 | systemd.log_level=debug |
58caedad | 116 | systemd.journald.max_level_console=debug |
26f51ae4 DDM |
117 | # udev's debug log output is very verbose, so up it to info in CI. |
118 | udev.log_level=info | |
a47c48cb DDM |
119 | # Root device can take a long time to appear, so let's bump the timeout. |
120 | systemd.default_device_timeout_sec=180 | |
24a0df5c | 121 | EOF |
6242cda9 | 122 | |
47e5e128 DDM |
123 | # For erofs, we have to install linux-modules-extra-azure, but that doesn't match the running kernel |
124 | # version, so we can't load the erofs module. squashfs is a builtin module so we use that instead. | |
125 | ||
bcb335ac | 126 | mkdir -p mkosi.images/system/mkosi.repart/10-usr.conf.d |
8c018edb | 127 | tee mkosi.images/system/mkosi.repart/10-usr.conf.d/squashfs.conf <<EOF |
47e5e128 DDM |
128 | [Partition] |
129 | Format=squashfs | |
130 | EOF | |
131 | ||
4cf5b343 LB |
132 | # The emergency shell is not useful in the CI, as it just blocks for a long time before the job |
133 | # eventually times out. Override it to just shutdown immediately. | |
bcb335ac DDM |
134 | mkdir -p mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/ |
135 | mkdir -p mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/ | |
8c018edb | 136 | tee mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf <<EOF |
4cf5b343 LB |
137 | [Unit] |
138 | FailureAction=exit | |
139 | [Service] | |
140 | ExecStartPre= | |
141 | ExecStart= | |
142 | ExecStart=false | |
143 | EOF | |
bcb335ac | 144 | cp mkosi.images/initrd/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf mkosi.images/system/mkosi.extra/usr/lib/systemd/system/emergency.service.d/poweroff.conf |
4cf5b343 | 145 | |
2de6cc18 | 146 | - name: Generate secure boot key |
93a94886 | 147 | run: mkosi --debug genkey |
2de6cc18 | 148 | |
bc763971 | 149 | - name: Show image summary |
c9853672 | 150 | run: mkosi summary |
715a273b | 151 | |
bc763971 | 152 | - name: Build |
93a94886 | 153 | run: mkosi --debug |
f997f91d | 154 | |
bc763971 | 155 | - name: Boot systemd-nspawn |
6aca147f | 156 | run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123 |
24acd406 | 157 | |
bc763971 | 158 | - name: Boot QEMU |
6aca147f | 159 | run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123 |