From daf09cd9ee926008270ddaade8fe9e4381d5c0da Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Mon, 17 Jan 2022 20:35:22 +0000 Subject: [PATCH] Add CentOS 8 and CentOS 9 tests Signed-off-by: Jonathan Dieter --- .github/workflows/main.yml | 2 +- autotest/centos-8-stream/build.sh | 11 +++++++++++ autotest/centos-8-stream/build/Dockerfile | 6 ++++++ autotest/centos-8-stream/prep.sh | 7 +++++++ autotest/centos-8-stream/prep/Dockerfile | 2 ++ autotest/centos-8-stream/test.sh | 15 +++++++++++++++ autotest/centos-9-stream/build.sh | 11 +++++++++++ autotest/centos-9-stream/build/Dockerfile | 6 ++++++ autotest/centos-9-stream/prep.sh | 7 +++++++ autotest/centos-9-stream/prep/Dockerfile | 2 ++ autotest/centos-9-stream/test.sh | 15 +++++++++++++++ 11 files changed, 83 insertions(+), 1 deletion(-) create mode 100755 autotest/centos-8-stream/build.sh create mode 100644 autotest/centos-8-stream/build/Dockerfile create mode 100755 autotest/centos-8-stream/prep.sh create mode 100644 autotest/centos-8-stream/prep/Dockerfile create mode 100755 autotest/centos-8-stream/test.sh create mode 100755 autotest/centos-9-stream/build.sh create mode 100644 autotest/centos-9-stream/build/Dockerfile create mode 100755 autotest/centos-9-stream/prep.sh create mode 100644 autotest/centos-9-stream/prep/Dockerfile create mode 100755 autotest/centos-9-stream/test.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14b63fa..c49806f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 index 0000000..33578f9 --- /dev/null +++ b/autotest/centos-8-stream/build.sh @@ -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 index 0000000..84aa5ee --- /dev/null +++ b/autotest/centos-8-stream/build/Dockerfile @@ -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 index 0000000..997582a --- /dev/null +++ b/autotest/centos-8-stream/prep.sh @@ -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 index 0000000..3a831d5 --- /dev/null +++ b/autotest/centos-8-stream/prep/Dockerfile @@ -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 index 0000000..8bd03a6 --- /dev/null +++ b/autotest/centos-8-stream/test.sh @@ -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 index 0000000..c9f490e --- /dev/null +++ b/autotest/centos-9-stream/build.sh @@ -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 index 0000000..84bd01a --- /dev/null +++ b/autotest/centos-9-stream/build/Dockerfile @@ -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 index 0000000..1157c9c --- /dev/null +++ b/autotest/centos-9-stream/prep.sh @@ -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 index 0000000..5e10c37 --- /dev/null +++ b/autotest/centos-9-stream/prep/Dockerfile @@ -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 index 0000000..a1ef52c --- /dev/null +++ b/autotest/centos-9-stream/test.sh @@ -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 -- 2.30.2