2021-10-01 13:09:20 +03:00
---
# vi: ts=2 sw=2 et:
2021-10-01 13:10:22 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2021-10-01 13:09:20 +03:00
# Simple boot tests that build and boot the mkosi images generated by the mkosi config files in mkosi.default.d/.
2020-11-30 23:57:52 +03:00
name : mkosi
on :
push :
branches :
2021-01-21 16:52:18 +03:00
- main
2021-11-12 19:37:15 +03:00
- v[0-9]+-stable
2022-11-10 17:00:53 +03:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 23:57:52 +03:00
pull_request :
branches :
2021-01-21 16:52:18 +03:00
- main
2021-11-12 19:37:15 +03:00
- v[0-9]+-stable
2022-11-10 17:00:53 +03:00
paths :
- '**'
- '!README*'
- '!LICENSE*'
- '!LICENSES/**'
- '!TODO'
- '!docs/**'
- '!man/**'
- '!catalog/**'
- '!shell-completion/**'
- '!po/**'
- '!.**'
- '.github/**'
2020-11-30 23:57:52 +03:00
2021-11-14 01:34:04 +03:00
permissions :
contents : read
2021-11-13 17:40:20 +03:00
2021-12-08 21:31:25 +03:00
env :
# Enable debug logging in systemd, but keep udev's log level to info,
# since it's _very_ verbose in the QEMU task
2022-08-26 01:02:29 +03:00
# Disable the ISC DHCP servers, as they are failing in Ubuntu
2023-03-07 17:22:59 +03:00
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"
2021-12-08 21:31:25 +03:00
2020-11-30 23:57:52 +03:00
jobs :
ci :
2022-06-21 21:53:42 +03:00
runs-on : ubuntu-22.04
2021-11-10 18:45:12 +03:00
concurrency :
2022-03-07 18:18:42 +03:00
group : ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
2021-11-10 18:45:12 +03:00
cancel-in-progress : true
2020-11-30 23:57:52 +03:00
strategy :
fail-fast : false
matrix :
2022-02-04 14:10:33 +03:00
include :
- distro : arch
release : rolling
- distro : debian
release : testing
- distro : ubuntu
2022-05-21 17:03:14 +03:00
release : jammy
2022-02-04 14:10:33 +03:00
- distro : fedora
2022-10-17 15:53:16 +03:00
release : "37"
2022-07-26 15:53:16 +03:00
- distro : fedora
release : rawhide
2022-02-04 14:10:33 +03:00
- distro : opensuse
release : tumbleweed
2023-01-10 14:04:10 +03:00
- distro : centos
2023-01-24 14:51:31 +03:00
release : "9"
2023-01-29 17:17:06 +03:00
- distro : centos
release : "8"
2020-11-30 23:57:52 +03:00
steps :
2023-03-01 12:58:39 +03:00
- uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
2023-03-11 15:32:29 +03:00
- uses : systemd/mkosi@9f1641bfa2e2a032d0b9278b34caf645a12562ac
2020-11-30 23:57:52 +03:00
2021-09-17 12:57:39 +03:00
- name : Configure
2022-02-04 14:10:33 +03:00
run : |
tee mkosi.default <<- EOF
[ Distribution]
Distribution=${{ matrix.distro }}
Release=${{ matrix.release }}
2023-02-09 11:53:05 +03:00
SecureBoot=yes
2022-02-04 14:10:33 +03:00
[ Content]
Environment=CI_BUILD=1
2023-03-16 14:12:38 +03:00
DEFAULT_TIMEOUT_SEC=90
2022-02-04 14:10:33 +03:00
[ Output]
KernelCommandLine=${{ env.KERNEL_CMDLINE }}
EOF
2021-01-03 18:05:06 +03:00
2023-01-31 20:53:28 +03:00
- name : Generate secure boot key
2023-02-09 11:53:05 +03:00
run : mkosi genkey
2023-01-31 20:53:28 +03:00
2020-11-30 23:57:52 +03:00
- name : Build ${{ matrix.distro }}
2023-02-09 11:53:05 +03:00
run : mkosi
2020-11-30 23:57:52 +03:00
2021-05-19 22:29:42 +03:00
- name : Show ${{ matrix.distro }} image summary
2023-02-09 11:53:05 +03:00
run : mkosi summary
2021-05-19 22:29:42 +03:00
2020-11-30 23:57:52 +03:00
- name : Boot ${{ matrix.distro }} systemd-nspawn
2023-03-07 17:23:35 +03:00
run : sudo mkosi boot ${{ env.KERNEL_CMDLINE }} audit=0
2021-12-08 21:31:25 +03:00
- name : Check ${{ matrix.distro }} systemd-nspawn
2023-03-07 17:23:35 +03:00
run : sudo mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }"
2020-11-30 23:57:52 +03:00
- name : Boot ${{ matrix.distro }} QEMU
2023-02-09 11:53:05 +03:00
run : timeout -k 30 10m mkosi qemu
2021-12-08 21:31:25 +03:00
- name : Check ${{ matrix.distro }} QEMU
2023-03-07 17:23:35 +03:00
run : sudo mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }"