Skip to content

Commit c3dab63

Browse files
committed
[ci] Add RHEL UBI9 as a new CI job
Well, sort of. UBI by itself does not provide all of the build requirements. Even when enabling EPEL. Some things are from the RHEL-9 CodeReady Builder repo, and that has been stripped down for UBI (along with BaseOS and AppStream). So, create a kind-of-UBI test environment. I start with UBI9 then I enable the CentOS Stream 9 BaseOS, AppStream, and CRB repos at a lower cost than UBI repos. Then install the build requirements and go from there. There does not appear to get the rest of RHEL-9 for UBI without getting a subscription, and I can't enable that in GitHub Actions. So I will just glue CentOS Stream packages on the UBI and hope for the best. In most cases this should mean my UBI CI job is "released UBI9 plus what will be in the next y-release of RHEL-9". Probably. Signed-off-by: David Cantrell <[email protected]>
1 parent 44e6e37 commit c3dab63

File tree

7 files changed

+170
-1
lines changed

7 files changed

+170
-1
lines changed

.github/workflows/ubi.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: RHEL UBI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- AUTHORS.md
8+
- CC-BY-4.0.txt
9+
- CHANGES.md
10+
- CODE_OF_CONDUCT.md
11+
- CONTRIBUTING.md
12+
- COPYING
13+
- COPYING.LIB
14+
- HISTORY
15+
- LICENSE-2.0.txt
16+
- MISSING
17+
- MIT.txt
18+
- README.md
19+
- RELEASE
20+
- TODO
21+
- 'contrib/**'
22+
- 'data/**'
23+
- 'doc/**'
24+
- 'po/**'
25+
- 'regress/**'
26+
27+
jobs:
28+
centos:
29+
# Use containers on their ubuntu latest image
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
matrix:
34+
container: ["registry.access.redhat.com/ubi9/ubi:latest"]
35+
36+
container:
37+
image: ${{ matrix.container }}
38+
39+
# All of these steps run from within the main source
40+
# directory, so think of that as your $PWD
41+
steps:
42+
# Requirements before the git clone can happen
43+
- name: git clone requirements
44+
run: |
45+
case "${{ matrix.container }}" in
46+
*ubi9)
47+
# UBI by itself does not contain every BR we
48+
# need, so supplement with CentOS Stream 9
49+
if [ -d /etc/yum.repos.d ]; then
50+
rm -f /etc/yum.repos.d/ubi.repo
51+
else
52+
mkdir -p /etc/yum.repos.d
53+
fi
54+
55+
for c in BaseOS AppStream CRB ; do
56+
echo "[c9s-${c}]" >> /etc/yum.repos.d/ubi.repo
57+
echo "name = CentOS Stream 9 - ${c}" >> /etc/yum.repos.d/ubi.repo
58+
echo "baseurl = https://mirror.stream.centos.org/9-stream/${c}/\$basearch/os/" >> /etc/yum.repos.d/ubi.repo
59+
echo "cost = 100" >> /etc/yum.repos.d/ubi.repo
60+
echo "enabled = 1" >> /etc/yum.repos.d/ubi.repo
61+
echo "gpgcheck = 0" >> /etc/yum.repos.d/ubi.repo
62+
echo >> /etc/yum.repos.d/ubi.repo
63+
done
64+
65+
# Upgrade things
66+
dnf upgrade -y
67+
68+
# Now enable EPEL and install git
69+
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
70+
dnf install -y git
71+
;;
72+
esac
73+
74+
75+
# This means clone the git repo
76+
- uses: actions/checkout@v4
77+
78+
# Within the container, install the dependencies, build,
79+
# and run the test suite
80+
- name: Build and run the test suite
81+
run: |
82+
# Install make(1) so we can use the instreqs target
83+
dnf install -y make
84+
85+
# Install build dependencies and set up the target
86+
make instreqs
87+
88+
# Build and run the test suite
89+
make debug
90+
make check
91+
92+
# Report coverage
93+
ninja -C build coverage && ( curl -s https://codecov.io/bash | bash ) || :

osdeps/ubi9/defs.mk

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PKG_CMD = dnf install -y
2+
PIP_CMD = pip3 install -I

osdeps/ubi9/pip.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cpp-coveralls
2+
gcovr
3+
PyYAML
4+
rpmfluff
5+
timeout-decorator

osdeps/ubi9/post.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
PATH=/bin:/usr/bin:/sbin:/usr/sbin
3+
4+
# Install 32-bit development files on x86_64 systems
5+
if [ "$(uname -m)" = "x86_64" ]; then
6+
dnf install -y glibc-devel.i686 glibc.i686 libgcc.i686
7+
fi
8+
9+
# Update clamav database
10+
freshclam

osdeps/ubi9/pre.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
PATH=/usr/bin
3+
4+
# Update pip and setuptools
5+
dnf install -y python3-pip
6+
pip3 install --upgrade pip setuptools

osdeps/ubi9/reqs.txt

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
annobin
2+
bash
3+
clamav-data
4+
clamav-devel
5+
clamav-update
6+
CUnit
7+
CUnit-devel
8+
desktop-file-utils
9+
elfutils-devel
10+
file-devel
11+
gcc
12+
gettext
13+
gettext-devel
14+
git
15+
glibc-devel
16+
json-c-devel
17+
kernel-core
18+
kernel-devel
19+
kmod-devel
20+
ksh
21+
libabigail
22+
libarchive-devel
23+
libcap-devel
24+
libcdson-devel
25+
libcurl-devel
26+
libffi-devel
27+
libicu-devel
28+
libmandoc-devel
29+
libxml2-devel
30+
libyaml-devel
31+
make
32+
meson
33+
ninja-build
34+
openssl-devel
35+
patchelf
36+
python3-devel
37+
python3-pip
38+
python3-pyyaml
39+
python3-rpm
40+
rc
41+
rpm-build
42+
rpm-devel
43+
sssd-client
44+
tcsh
45+
valgrind
46+
xhtml1-dtds
47+
xmlrpc-c-devel
48+
zlib-devel
49+
zsh

utils/determine-os.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ elif [ -r /etc/redhat-release ] && [ "${ID}" = "rhel" ]; then
4040
v="$(echo "${VERSION_ID}" | cut -d '.' -f 1)"
4141
case "${v}" in
4242
7|8|9)
43-
echo "${ID}${v}"
43+
if [ -f /etc/yum.repos.d/ubi.repo ]; then
44+
echo "ubi${v}"
45+
else
46+
echo "${ID}${v}"
47+
fi
4448
;;
4549
*)
4650
echo "unknown OS: ${ID}:${v}" >&2

0 commit comments

Comments
 (0)