Skip to content

Commit 4b66bcf

Browse files
committed
Support Msgpack-C, add RedHat to test matrix
* Add support for libmsgpack-c (installed from source) * Add Red Hat UBI 8.8 and UBI 9.2 to the build matrix * Shorten GHA job names
1 parent b31fabe commit 4b66bcf

File tree

2 files changed

+43
-12
lines changed

2 files changed

+43
-12
lines changed

.github/workflows/build.yml

+31-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ name: Build and test (OS matrix)
44
on: [push, pull_request, workflow_dispatch]
55

66
jobs:
7-
8-
build-and-test-ubuntu:
7+
validation-linux:
98
strategy:
109
fail-fast: false # don't cancel other jobs in the matrix if one fails
1110
matrix:
@@ -22,6 +21,12 @@ jobs:
2221
- runner: ubuntu-20.04
2322
container: ubuntu:23.04
2423
os_name: ubuntu-23.04
24+
- runner: ubuntu-20.04
25+
container: redhat/ubi8:8.8
26+
os_name: redhat-8.8
27+
- runner: ubuntu-20.04
28+
container: redhat/ubi9:9.2
29+
os_name: redhat-9.2
2530

2631
runs-on: ${{ matrix.runner }}
2732

@@ -36,14 +41,33 @@ jobs:
3641
steps:
3742
- uses: actions/checkout@v3
3843

39-
- name: Fetch package lists
40-
run: apt-get -y update
41-
42-
- name: Install dependencies
44+
- name: Fetch package lists and install dependencies (Ubuntu)
45+
if: contains(matrix.os_name, 'ubuntu-')
4346
run: |
47+
apt-get -y update
4448
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated --allow-downgrades --allow-remove-essential --allow-change-held-packages \
4549
install make gcc libevent-dev libmsgpack-dev curl uuid nodejs python3 python3-pip
4650
51+
# (using `rm` + `ln` since using `alternatives` doesn't work on both UBI 8 and UBI 9)
52+
- name: Install dependencies (Red Hat)
53+
if: contains(matrix.os_name, 'redhat-')
54+
run: |
55+
yum install -y --allowerasing make cmake gcc gcc-c++ libevent-devel git curl uuid nodejs python3.11 python3.11-pip
56+
rm -f /usr/bin/python3 /usr/bin/pip3
57+
ln -s $(which python3.11) /usr/bin/python3
58+
ln -s $(which pip3.11) /usr/bin/pip3
59+
60+
- name: Install msgpack-c (Red Hat)
61+
if: contains(matrix.os_name, 'redhat-')
62+
run: |
63+
cd /tmp
64+
curl -sLO https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz
65+
tar -xzf msgpack-c-6.0.0.tar.gz
66+
cd msgpack-c-6.0.0
67+
cmake -DMSGPACK_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib64 .
68+
make
69+
make install
70+
4771
- name: Fix pip3 on Ubuntu 23.04
4872
if: matrix.os_name == 'ubuntu-23.04'
4973
run: rm -f /usr/lib/python$(python3 --version | cut -d ' ' -f 2 | cut -d '.' -f 1,2)/EXTERNALLY-MANAGED
@@ -73,8 +97,7 @@ jobs:
7397
path: webdis.log
7498

7599

76-
77-
build-and-test-macos:
100+
validation-macos:
78101
strategy:
79102
fail-fast: false
80103
matrix:

Makefile

+12-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@ ifeq ($(strip $(MSGPACKC_LD)),0)
3838
FORMAT_OBJS += src/formats/msgpack.o
3939
CFLAGS += -DMSGPACK=1
4040
LDFLAGS += -lmsgpackc
41-
endif
42-
endif
43-
endif
44-
endif
41+
else
42+
# check for MessagePack-C (note the dash)
43+
MSGPACK_C_LD=$(shell ld -lmsgpack-c >/dev/null 2>/dev/null; echo $$?)
44+
ifeq ($(strip $(MSGPACK_C_LD)),0)
45+
FORMAT_OBJS += src/formats/msgpack.o
46+
CFLAGS += -DMSGPACK=1
47+
LDFLAGS += -lmsgpack-c
48+
endif # MSGPACK_C_LD
49+
endif # MSGPACKC_LD
50+
endif # MSGPACK_OSX_LIB
51+
endif # MSGPACKC_LIB
52+
endif # MSGPACK_LIB
4553

4654
# if `make` is run with DEBUG=1, include debug symbols
4755
DEBUG_FLAGS=

0 commit comments

Comments
 (0)