diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1032324..8c860e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,10 +59,26 @@ jobs: image: debian:sid typ: debian allow-failure: true + - + 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 diff --git a/base/Dockerfile b/base/Dockerfile index 4a8fe8b..72b5687 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -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 @@ -33,6 +34,16 @@ RUN --mount=type=cache,target=/pkg-cache \ WORKDIR /work FROM ${TEST_BASE_IMAGE} AS test-base-rhel +RUN </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 && \ diff --git a/base/test-info-rhel.bats b/base/test-info-rhel.bats index 4b0bb05..ab022d3 100755 --- a/base/test-info-rhel.bats +++ b/base/test-info-rhel.bats @@ -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" {