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 :
group : ${{ github.workflow }}-${{ matrix.distro }}-${{ github.ref }}
cancel-in-progress : true
2020-11-30 23:57:52 +03:00
strategy :
fail-fast : false
matrix :
distro :
- arch
- debian
- ubuntu
- fedora
2021-11-04 17:38:24 +03:00
- opensuse
2020-11-30 23:57:52 +03:00
steps :
2021-11-13 12:36:24 +03:00
- uses : actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
2022-01-03 15:07:21 +03:00
- uses : systemd/mkosi@01ea953fd2af738f974b228991c768c12b50db95
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
2021-10-01 13:09:20 +03:00
run : echo -e "[Distribution]\nDistribution=${{ matrix.distro }}\n" >mkosi.default
2021-01-03 18:05:06 +03:00
2021-02-26 19:06:25 +03:00
# Ubuntu's systemd-nspawn doesn't support faccessat2() syscall, which is
# required, since current Arch's glibc implements faccessat() via faccessat2().
- name : Update systemd-nspawn
if : ${{ matrix.distro == 'arch' }}
run : |
echo "deb-src http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt build-dep systemd
meson build
ninja -C build
sudo ln -svf $PWD/build/systemd-nspawn `which systemd-nspawn`
systemd-nspawn --version
2020-11-30 23:57:52 +03:00
- name : Build ${{ matrix.distro }}
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh --build-environment=CI_BUILD=1 --kernel-command-line "${{ env.KERNEL_CMDLINE }}" 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
- name : Boot ${{ matrix.distro }} QEMU
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
2021-12-09 20:03:50 +03:00
run : ./.github/workflows/run_mkosi.sh shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }"