richardphibel / rpms / systemd

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