812ca2
From ccde55a339d211af488b1f1c148597d7977a9bb8 Mon Sep 17 00:00:00 2001
812ca2
From: Frantisek Sumsal <frantisek@sumsal.cz>
812ca2
Date: Wed, 3 Mar 2021 12:49:20 +0100
812ca2
Subject: [PATCH] ci: run unit tests on CentOS 8 Stream as well
812ca2
812ca2
rhel-only
812ca2
Related: #1934504
812ca2
---
812ca2
 .github/workflows/unit_tests.sh  | 52 +++++++++++++++++++++++++++++++-
812ca2
 .github/workflows/unit_tests.yml | 13 ++++----
812ca2
 2 files changed, 58 insertions(+), 7 deletions(-)
812ca2
812ca2
diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh
812ca2
index 43882b27da..8648e7149e 100755
812ca2
--- a/.github/workflows/unit_tests.sh
812ca2
+++ b/.github/workflows/unit_tests.sh
812ca2
@@ -58,6 +58,53 @@ CONFIGURE_OPTS=(
812ca2
     -Ddefault-hierarchy=legacy
812ca2
 )
812ca2
 
812ca2
+# CentOS 8 Stream still doesn't provide SRPMs, so we can't use dnf's builddep
812ca2
+# command to fetch this list for us. Hopefully, we'll be able to get rid
812ca2
+# of this in the future.
812ca2
+# See: https://bugs.centos.org/view.php?id=16715
812ca2
+SYSTEMD_BUILD_DEPS=(
812ca2
+        audit-libs-devel
812ca2
+        bzip2-devel
812ca2
+        cryptsetup-devel
812ca2
+        dbus-devel
812ca2
+        docbook-style-xsl
812ca2
+        elfutils-devel
812ca2
+        firewalld-filesystem
812ca2
+        gcc
812ca2
+        gcc-c++
812ca2
+        gettext
812ca2
+        git
812ca2
+        gnu-efi
812ca2
+        gnu-efi-devel
812ca2
+        gnutls-devel
812ca2
+        gobject-introspection-devel
812ca2
+        gperf
812ca2
+        iptables-devel
812ca2
+        kmod-devel
812ca2
+        libacl-devel
812ca2
+        libblkid-devel
812ca2
+        libcap-devel
812ca2
+        libcurl-devel
812ca2
+        libgcrypt-devel
812ca2
+        libgpg-error-devel
812ca2
+        libidn2-devel
812ca2
+        libmicrohttpd-devel
812ca2
+        libmount-devel
812ca2
+        libseccomp-devel
812ca2
+        libselinux-devel
812ca2
+        libxkbcommon-devel
812ca2
+        libxslt
812ca2
+        lz4
812ca2
+        lz4-devel
812ca2
+        meson
812ca2
+        pam-devel
812ca2
+        pkgconf-pkg-config
812ca2
+        python3-lxml
812ca2
+        python36-devel
812ca2
+        tree
812ca2
+        xz-devel
812ca2
+)
812ca2
+
812ca2
 function info() {
812ca2
     echo -e "\033[33;1m$1\033[0m"
812ca2
 }
812ca2
@@ -85,7 +132,10 @@ for phase in "${PHASES[@]}"; do
812ca2
             # Upgrade the container to get the most recent environment
812ca2
             $DOCKER_EXEC dnf -y upgrade
812ca2
             # Install systemd's build dependencies
812ca2
-            $DOCKER_EXEC dnf -q -y --enablerepo "powertools" builddep systemd
812ca2
+            if ! $DOCKER_EXEC dnf -q -y --enablerepo "powertools" builddep systemd; then
812ca2
+                    # See the $SYSTEMD_BUILD_DEPS above for reasoning
812ca2
+                    $DOCKER_EXEC dnf -q -y --enablerepo "powertools" install "${SYSTEMD_BUILD_DEPS[@]}"
812ca2
+            fi
812ca2
             ;;
812ca2
         RUN|RUN_GCC)
812ca2
             info "Run phase"
812ca2
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
812ca2
index 428bde4ed8..b363118be8 100644
812ca2
--- a/.github/workflows/unit_tests.yml
812ca2
+++ b/.github/workflows/unit_tests.yml
812ca2
@@ -7,19 +7,20 @@ on: [pull_request]
812ca2
 jobs:
812ca2
   build:
812ca2
     runs-on: ubuntu-20.04
812ca2
-    env:
812ca2
-      CENTOS_RELEASE: "centos8"
812ca2
-      CONT_NAME:      "systemd-centos8-ci"
812ca2
     strategy:
812ca2
       fail-fast: false
812ca2
       matrix:
812ca2
-        run_phase: [GCC, GCC_ASAN]
812ca2
+        image: [centos8, stream8]
812ca2
+        phase: [GCC, GCC_ASAN]
812ca2
+    env:
812ca2
+      CONT_NAME: "systemd-centos8-ci"
812ca2
+      CENTOS_RELEASE: ${{ matrix.image }}
812ca2
     steps:
812ca2
       - name: Repository checkout
812ca2
         uses: actions/checkout@v1
812ca2
       - name: Install build dependencies
812ca2
         run: sudo -E .github/workflows/unit_tests.sh SETUP
812ca2
-      - name: Build & test (${{ matrix.run_phase }})
812ca2
-        run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.run_phase }}
812ca2
+      - name: Build & test (${{ env.CENTOS_RELEASE }} / ${{ matrix.phase }})
812ca2
+        run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.phase }}
812ca2
       - name: Cleanup
812ca2
         run: sudo -E .github/workflows/unit_tests.sh CLEANUP