Skip to content

Commit

Permalink
ci: test against supported rhel distribs
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Nov 17, 2021
1 parent c815c79 commit b75e80b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ jobs:
image: debian:sid
typ: debian
allow-failure: true
-
image: fedora:35
typ: rhel
allow-failure: false
-
image: ubuntu:20.04
typ: debian
Expand All @@ -71,6 +67,26 @@ jobs:
image: ubuntu:21.10
typ: debian
allow-failure: false
-
image: redhat/ubi8
typ: rhel
allow-failure: false
-
image: fedora:35
typ: rhel
allow-failure: false
-
image: centos:8
typ: rhel
allow-failure: false
-
image: rockylinux/rockylinux:8
typ: rhel
allow-failure: false
-
image: oraclelinux:8
typ: rhel
allow-failure: false
steps:
-
name: Checkout
Expand Down
13 changes: 12 additions & 1 deletion base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#syntax=docker/dockerfile:1.2
# syntax=docker/dockerfile:1.3-labs

ARG TEST_BASE_TYPE=alpine
ARG TEST_BASE_IMAGE=${TEST_BASE_TYPE}
ARG TEST_WITH_DARWIN=false
Expand Down Expand Up @@ -33,6 +34,16 @@ RUN --mount=type=cache,target=/pkg-cache \
WORKDIR /work

FROM ${TEST_BASE_IMAGE} AS test-base-rhel
RUN <<EOT
set -ex
if ! yum install -y epel-release; then
if . /etc/os-release 2>/dev/null; then
if [ "$ID" != "fedora" ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION:0:1}.noarch.rpm
fi
fi
fi
EOT
RUN --mount=type=cache,target=/pkg-cache \
rm -rf /var/cache/yum && \
ln -s /pkg-cache /var/cache/yum && \
Expand Down
13 changes: 12 additions & 1 deletion base/test-info-rhel.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

load "assert"

vendor="rhel"
if grep </etc/redhat-release "Fedora" 2>/dev/null >/dev/null; then
vendor="fedora"
elif grep </etc/redhat-release "CentOS" 2>/dev/null >/dev/null; then
vendor="centos"
elif grep </etc/redhat-release "Rocky Linux" 2>/dev/null >/dev/null; then
vendor="rocky"
elif [ -f /etc/oracle-release ] && grep </etc/oracle-release "Oracle Linux" 2>/dev/null >/dev/null; then
vendor="ol"
fi

@test "vendor" {
assert_equal "fedora" "$(xx-info vendor)"
assert_equal "$vendor" "$(xx-info vendor)"
}

@test "rhel-arch" {
Expand Down

0 comments on commit b75e80b

Please sign in to comment.