ryantimwilson / rpms / systemd

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