Add CentOS 8 and CentOS 9 tests
authorJonathan Dieter <jdieter@gmail.com>
Mon, 17 Jan 2022 20:35:22 +0000 (20:35 +0000)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 17 Jan 2022 20:35:22 +0000 (20:35 +0000)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
.github/workflows/main.yml
autotest/centos-8-stream/build.sh [new file with mode: 0755]
autotest/centos-8-stream/build/Dockerfile [new file with mode: 0644]
autotest/centos-8-stream/prep.sh [new file with mode: 0755]
autotest/centos-8-stream/prep/Dockerfile [new file with mode: 0644]
autotest/centos-8-stream/test.sh [new file with mode: 0755]
autotest/centos-9-stream/build.sh [new file with mode: 0755]
autotest/centos-9-stream/build/Dockerfile [new file with mode: 0644]
autotest/centos-9-stream/prep.sh [new file with mode: 0755]
autotest/centos-9-stream/prep/Dockerfile [new file with mode: 0644]
autotest/centos-9-stream/test.sh [new file with mode: 0755]

index 14b63fac47ceb0ccba4d88d77afc5f5744a613bc..c49806fb35ef863fb1fed19626603c2127ab2925 100644 (file)
@@ -13,7 +13,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        container_directory: [fedora-latest, centos-7, alpine-edge, opensuse-leap, debian-latest, ubuntu-rolling, ubuntu-lts]
+        container_directory: [fedora-latest, centos-7, centos-8-stream, centos-9-stream, alpine-edge, opensuse-leap, debian-latest, ubuntu-rolling, ubuntu-lts]
 
     name: Compile and run tests
     steps:
diff --git a/autotest/centos-8-stream/build.sh b/autotest/centos-8-stream/build.sh
new file mode 100755 (executable)
index 0000000..33578f9
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Build zchunk-centos:8 if it doesn't exist
+HAVE_IMAGE=$(docker image ls -q zchunk-centos:8)
+if [ "$HAVE_IMAGE" == "" ]; then
+       autotest/centos-8-stream/prep.sh
+       if [ "$?" -ne 0 ]; then
+               exit 1
+       fi
+fi
+docker image rm zchunk-centos-8:test -f 2>/dev/null 1>/dev/null
+docker image build -t zchunk-centos-8:test --file autotest/centos-8-stream/build/Dockerfile ./
diff --git a/autotest/centos-8-stream/build/Dockerfile b/autotest/centos-8-stream/build/Dockerfile
new file mode 100644 (file)
index 0000000..84aa5ee
--- /dev/null
@@ -0,0 +1,6 @@
+FROM zchunk-centos:8
+ADD ./ /code
+WORKDIR /code
+RUN meson build --auto-features=enabled && cd build && ninja-build
+WORKDIR /code/build
+CMD ninja-build test
diff --git a/autotest/centos-8-stream/prep.sh b/autotest/centos-8-stream/prep.sh
new file mode 100755 (executable)
index 0000000..997582a
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+docker pull docker.io/tgagor/centos:stream8
+if [ "$?" -ne 0 ]; then
+        exit 1
+fi
+docker image rm -f zchunk-centos:8 2>/dev/null 1>/dev/null
+docker image build -t zchunk-centos:8 --file autotest/centos-8-stream/prep/Dockerfile ./
diff --git a/autotest/centos-8-stream/prep/Dockerfile b/autotest/centos-8-stream/prep/Dockerfile
new file mode 100644 (file)
index 0000000..3a831d5
--- /dev/null
@@ -0,0 +1,2 @@
+FROM docker.io/tgagor/centos:stream8
+RUN sed -i "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Stream-PowerTools.repo && dnf -y install meson gcc "pkgconfig(libzstd)" "pkgconfig(libcurl)" "pkgconfig(openssl)" && rm -rf /var/cache/yum
diff --git a/autotest/centos-8-stream/test.sh b/autotest/centos-8-stream/test.sh
new file mode 100755 (executable)
index 0000000..8bd03a6
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Build zchunk-centos:8 if it doesn't exist
+HAVE_IMAGE=$(docker image ls -q zchunk-centos-8:test)
+if [ "$HAVE_IMAGE" == "" ]; then
+       autotest/centos-8-stream/build.sh
+       if [ "$?" -ne 0 ]; then
+               exit 1
+       fi
+fi
+docker rm zchunk-centos-8-test -f 2>/dev/null 1>/dev/null
+docker run --name zchunk-centos-8-test zchunk-centos-8:test
+RETVAL=$?
+docker rm zchunk-centos-8-test -f 2>/dev/null 1>/dev/null
+docker image rm zchunk-centos-8:test -f 2>/dev/null 1>/dev/null
+exit $RETVAL
diff --git a/autotest/centos-9-stream/build.sh b/autotest/centos-9-stream/build.sh
new file mode 100755 (executable)
index 0000000..c9f490e
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Build zchunk-centos:9 if it doesn't exist
+HAVE_IMAGE=$(docker image ls -q zchunk-centos:9)
+if [ "$HAVE_IMAGE" == "" ]; then
+       autotest/centos-9-stream/prep.sh
+       if [ "$?" -ne 0 ]; then
+               exit 1
+       fi
+fi
+docker image rm zchunk-centos-9:test -f 2>/dev/null 1>/dev/null
+docker image build -t zchunk-centos-9:test --file autotest/centos-9-stream/build/Dockerfile ./
diff --git a/autotest/centos-9-stream/build/Dockerfile b/autotest/centos-9-stream/build/Dockerfile
new file mode 100644 (file)
index 0000000..84bd01a
--- /dev/null
@@ -0,0 +1,6 @@
+FROM zchunk-centos:9
+ADD ./ /code
+WORKDIR /code
+RUN meson build --auto-features=enabled && cd build && ninja-build
+WORKDIR /code/build
+CMD ninja-build test
diff --git a/autotest/centos-9-stream/prep.sh b/autotest/centos-9-stream/prep.sh
new file mode 100755 (executable)
index 0000000..1157c9c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+docker pull docker.io/tgagor/centos:stream9
+if [ "$?" -ne 0 ]; then
+        exit 1
+fi
+docker image rm -f zchunk-centos:9 2>/dev/null 1>/dev/null
+docker image build -t zchunk-centos:9 --file autotest/centos-9-stream/prep/Dockerfile ./
diff --git a/autotest/centos-9-stream/prep/Dockerfile b/autotest/centos-9-stream/prep/Dockerfile
new file mode 100644 (file)
index 0000000..5e10c37
--- /dev/null
@@ -0,0 +1,2 @@
+FROM docker.io/tgagor/centos:stream9
+RUN dnf -y install "dnf-command(config-manager)" && dnf -y config-manager --set-enabled crb && dnf -y install meson gcc "pkgconfig(libzstd)" "pkgconfig(libcurl)" "pkgconfig(openssl)" && rm -rf /var/cache/yum
diff --git a/autotest/centos-9-stream/test.sh b/autotest/centos-9-stream/test.sh
new file mode 100755 (executable)
index 0000000..a1ef52c
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Build zchunk-centos:9 if it doesn't exist
+HAVE_IMAGE=$(docker image ls -q zchunk-centos-9:test)
+if [ "$HAVE_IMAGE" == "" ]; then
+       autotest/centos-9-stream/build.sh
+       if [ "$?" -ne 0 ]; then
+               exit 1
+       fi
+fi
+docker rm zchunk-centos-9-test -f 2>/dev/null 1>/dev/null
+docker run --name zchunk-centos-9-test zchunk-centos-9:test
+RETVAL=$?
+docker rm zchunk-centos-9-test -f 2>/dev/null 1>/dev/null
+docker image rm zchunk-centos-9:test -f 2>/dev/null 1>/dev/null
+exit $RETVAL