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
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
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
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"
2020-11-30 23:57:52 +03:00
jobs :
ci :
runs-on : ubuntu-20.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
release : focal
- distro : fedora
2022-05-12 20:46:13 +03:00
release : "36"
2022-02-04 14:10:33 +03:00
- distro : opensuse
release : tumbleweed
- distro : centos_epel
release : 8 -stream
2022-02-28 13:12:04 +03:00
- distro : centos_epel
release : 9 -stream
2020-11-30 23:57:52 +03:00
steps :
2022-05-01 12:04:12 +03:00
- uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
2022-04-20 20:10:22 +03:00
- uses : systemd/mkosi@93098e2406e12ea7f06f962d4808952b8a06d345
2020-11-30 23:57:52 +03:00
- name : Install
2021-05-17 11:36:30 +03:00
run : sudo apt-get update && sudo apt-get install --no-install-recommends python3-pexpect python3-jinja2
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 }}
[ Content]
Environment=CI_BUILD=1
[ Output]
KernelCommandLine=${{ env.KERNEL_CMDLINE }}
EOF
2021-01-03 18:05:06 +03:00
2020-11-30 23:57:52 +03:00
- name : Build ${{ matrix.distro }}
2022-02-04 14:10:33 +03:00
run : ./.github/workflows/run_mkosi.sh build
2020-11-30 23:57:52 +03:00
2021-05-19 22:29:42 +03:00
- name : Show ${{ matrix.distro }} image summary
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh summary
2021-05-19 22:29:42 +03:00
2020-11-30 23:57:52 +03:00
- name : Boot ${{ matrix.distro }} systemd-nspawn
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh boot ${{ env.KERNEL_CMDLINE }}
2021-12-08 21:31:25 +03:00
- name : Check ${{ matrix.distro }} systemd-nspawn
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }"
2020-11-30 23:57:52 +03:00
2022-02-04 14:10:33 +03:00
# TODO: Remove CentOS exclusion once Ubuntu 22.04 is available in GA.
# See https://github.com/systemd/systemd/pull/22417 and https://github.com/systemd/mkosi/pull/907 for
# more information.
2020-11-30 23:57:52 +03:00
- name : Boot ${{ matrix.distro }} QEMU
2022-02-04 14:10:33 +03:00
if : ${{ matrix.distro != 'centos_epel' }}
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh qemu
2021-12-08 21:31:25 +03:00
- name : Check ${{ matrix.distro }} QEMU
2022-02-04 14:10:33 +03:00
if : ${{ matrix.distro != 'centos_epel' }}
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }"