]>
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 | |
aa1bf7e6 | 62 | release: jammy |
24a0df5c | 63 | - distro: fedora |
755012d3 | 64 | release: "39" |
2d625795 DDM |
65 | - distro: fedora |
66 | release: rawhide | |
24a0df5c DDM |
67 | - distro: opensuse |
68 | release: tumbleweed | |
9d2e4cee | 69 | - distro: centos |
c8943ce8 | 70 | release: "9" |
868c318b DDM |
71 | - distro: centos |
72 | release: "8" | |
448d3462 | 73 | |
93a94886 DDM |
74 | env: |
75 | SYSTEMD_LOG_LEVEL: debug | |
76 | ||
448d3462 | 77 | steps: |
094632a0 | 78 | - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 |
6e24a9dc | 79 | - uses: systemd/mkosi@16e63baaeadf7a5b100c5b5bf780c61c29878cfc |
448d3462 | 80 | |
7e99216c | 81 | - name: Configure |
24a0df5c | 82 | run: | |
94c9855a | 83 | tee mkosi.conf <<- EOF |
24a0df5c DDM |
84 | [Distribution] |
85 | Distribution=${{ matrix.distro }} | |
86 | Release=${{ matrix.release }} | |
35356d7f | 87 | EOF |
24a0df5c | 88 | |
35356d7f | 89 | tee mkosi.conf.d/99-ci.conf <<- EOF |
24a0df5c DDM |
90 | [Content] |
91 | Environment=CI_BUILD=1 | |
4bfcb6ba | 92 | SLOW_TESTS=true |
24a0df5c | 93 | |
35356d7f | 94 | [Host] |
58caedad DDM |
95 | KernelCommandLineExtra=systemd.unit=mkosi-check-and-shutdown.service |
96 | systemd.journald.max_level_console=debug | |
26f51ae4 DDM |
97 | # udev's debug log output is very verbose, so up it to info in CI. |
98 | udev.log_level=info | |
a47c48cb DDM |
99 | # Root device can take a long time to appear, so let's bump the timeout. |
100 | systemd.default_device_timeout_sec=180 | |
86605eed | 101 | QemuVsock=yes |
94c357ca | 102 | Ephemeral=yes |
24a0df5c | 103 | EOF |
6242cda9 | 104 | |
47e5e128 DDM |
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 | ||
1f035c91 DDM |
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 | |
47e5e128 DDM |
110 | [Partition] |
111 | Format=squashfs | |
112 | EOF | |
113 | ||
4cf5b343 LB |
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. | |
1f035c91 DDM |
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 | |
4cf5b343 LB |
119 | [Unit] |
120 | FailureAction=exit | |
121 | [Service] | |
122 | ExecStartPre= | |
123 | ExecStart= | |
124 | ExecStart=false | |
125 | EOF | |
1f035c91 | 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 |
4cf5b343 | 127 | |
2de6cc18 | 128 | - name: Generate secure boot key |
93a94886 | 129 | run: mkosi --debug genkey |
2de6cc18 | 130 | |
bc763971 | 131 | - name: Show image summary |
c9853672 | 132 | run: mkosi summary |
715a273b | 133 | |
bc763971 | 134 | - name: Build |
93a94886 | 135 | run: mkosi --debug |
f997f91d | 136 | |
bc763971 | 137 | - name: Boot systemd-nspawn |
6aca147f | 138 | run: test "$(sudo mkosi --debug boot 1>&2; echo $?)" -eq 123 |
24acd406 | 139 | |
bc763971 | 140 | - name: Boot QEMU |
6aca147f | 141 | run: timeout -k 30 10m test "$(mkosi --debug qemu 1>&2; echo $?)" -eq 123 |