Skip to content

ci-cd opt.

ci-cd opt. #541

Workflow file for this run

name: OpenLDAP Test
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_gnutls:
name: Build wolfSSL, GnuTLS and provider
timeout-minutes: 30
strategy:
matrix:
include:
- os: ubuntu-latest
openldap_ref: 'OPENLDAP_REL_ENG_2_5_13'
use_container: true
- os: ubuntu-24.04
openldap_ref: 'OPENLDAP_REL_ENG_2_6_7'
use_container: false
- os: ubuntu-latest
openldap_ref: 'OPENLDAP_REL_ENG_2_6_9'
use_container: true
fail-fast: false
runs-on: ${{ matrix.os }}
container: ${{ matrix.use_container && 'debian:bookworm' || '' }}
steps:
- name: Checkout gnutls-wolfssl repository
uses: actions/checkout@v4
- name: Ensure make available
if: matrix.use_container == true
run: |
apt-get update
apt-get install -y build-essential
- name: Install GnuTLS dependencies
if: matrix.use_container == true
run: |
apt-get install -y gnulib autopoint gperf gtk-doc-tools nettle-dev clang \
libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev sudo \
git wget automake libtool
- name: Install OpenLDAP dependencies
if: matrix.use_container == true
run: |
sudo apt-get install -y libsasl2-dev libsasl2-modules libsasl2-modules-gssapi-mit \
libargon2-dev groff-base libltdl-dev
- name: Install dependencies on native Ubuntu
if: matrix.use_container == false
run: |
sudo apt-get update
sudo apt-get install -y build-essential gnulib autopoint gperf gtk-doc-tools nettle-dev clang \
libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev \
git wget libsasl2-dev libsasl2-modules libsasl2-modules-gssapi-mit \
libargon2-dev groff-base libltdl-dev automake libtool
- name: Prepare cache directories (native runner)
if: matrix.use_container == false
run: |
sudo mkdir -p /opt/gnutls /opt/wolfssl /opt/wolfssl-gnutls-wrapper /opt/nettle
sudo chown -R $USER:$USER /opt/gnutls /opt/wolfssl /opt/wolfssl-gnutls-wrapper /opt/nettle
- name: Restore cached gnutls-wolfssl
id: cache-gnutls
uses: actions/cache@v4
with:
path: |
${{ matrix.use_container && '/opt/gnutls' || '~/cache/gnutls' }}
${{ matrix.use_container && '/opt/wolfssl' || '~/cache/wolfssl' }}
${{ matrix.use_container && '/opt/wolfssl-gnutls-wrapper' || '~/cache/wolfssl-gnutls-wrapper' }}
${{ !matrix.use_container && '~/cache/nettle' || '' }}
key: gnutls-wolfssl-${{ matrix.use_container == false && '3.8.11' || '3.8.9' }}-${{ runner.os }}-${{ matrix.use_container }}-${{ hashFiles('setup.sh', 'wolfssl-gnutls-wrapper/**', 'wolfssl/**', 'gnutls/**') }}
restore-keys: |
gnutls-wolfssl-${{ matrix.use_container == false && '3.8.11' || '3.8.9' }}-${{ runner.os }}-${{ matrix.use_container }}-
- name: Copy cache to /opt (native runner only)
if: matrix.use_container == false && steps.cache-gnutls.outputs.cache-hit == 'true'
run: |
sudo mkdir -p /opt
sudo cp -a ~/cache/gnutls /opt/
sudo cp -a ~/cache/wolfssl /opt/
sudo cp -a ~/cache/wolfssl-gnutls-wrapper /opt/
if [ -d ~/cache/nettle ]; then
sudo cp -a ~/cache/nettle /opt/
fi
- name: Setup nettle environment (native runner only)
if: matrix.use_container == false
run: |
# Set up environment for nettle 3.10 in /opt/nettle
echo "PKG_CONFIG_PATH=/opt/nettle/lib64/pkgconfig:/opt/nettle/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/nettle/lib64:/opt/nettle/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Build GnuTLS with wolfSSL provider using setup.sh script
if: steps.cache-gnutls.outputs.cache-hit != 'true'
run: |
echo "Running setup.sh..."
if [[ "${{ matrix.use_container }}" == "false" ]]; then
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl NETTLE_INSTALL=/opt/nettle ./setup.sh 3.8.11
else
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh
fi
if [[ "${{ matrix.use_container }}" == "false" ]]; then
mkdir -p ~/cache
sudo cp -a /opt/gnutls ~/cache/
sudo cp -a /opt/wolfssl ~/cache/
sudo cp -a /opt/wolfssl-gnutls-wrapper ~/cache/
if [ -d /opt/nettle ]; then
sudo cp -a /opt/nettle ~/cache/
fi
sudo chown -R $(id -u):$(id -g) ~/cache
fi
- name: Check setup.sh output directories
run: |
test -d /opt/wolfssl || { echo "/opt/wolfssl missing"; exit 1; }
test -d /opt/gnutls || { echo "/opt/gnutls missing"; exit 1; }
test -d /opt/wolfssl-gnutls-wrapper/lib || { echo "/opt/wolfssl-gnutls-wrapper/lib missing"; exit 1; }
if [[ "${{ matrix.use_container }}" == "false" ]]; then
test -d /opt/nettle || { echo "/opt/nettle missing"; exit 1; }
fi
- name: Verify GnuTLS version (native runner only)
if: matrix.use_container == false
run: |
export LD_LIBRARY_PATH=/opt/nettle/lib64:/opt/nettle/lib:/opt/gnutls/lib:/opt/wolfssl/lib:$LD_LIBRARY_PATH
GNUTLS_VERSION=$(/opt/gnutls/bin/gnutls-cli --version 2>&1 | grep -oP 'gnutls-cli \K[0-9]+\.[0-9]+\.[0-9]+')
echo "Detected GnuTLS version: $GNUTLS_VERSION"
if [ "$GNUTLS_VERSION" != "3.8.11" ]; then
echo "ERROR: Expected GnuTLS 3.8.11 but got $GNUTLS_VERSION"
exit 1
fi
echo "GnuTLS version verified: 3.8.11"
- name: Build OpenLDAP at ${{ matrix.openldap_ref }}
run: |
git clone --depth 1 --branch "${{ matrix.openldap_ref }}" \
https://git.openldap.org/openldap/openldap.git
- name: Configure OpenLDAP
working-directory: openldap
run: |
export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig:$PKG_CONFIG_PATH
export CPPFLAGS=-I/opt/gnutls/include
if [[ "${{ matrix.openldap_ref }}" = "OPENLDAP_REL_ENG_2_6_7" ]]; then
export LDFLAGS="-L/opt/nettle/lib64 -L/opt/nettle/lib -L/opt/gnutls/lib -Wl,-rpath,/opt/nettle/lib64 -Wl,-rpath,/opt/nettle/lib -Wl,-rpath,/opt/gnutls/lib"
./configure \
ac_cv_func_memcmp_working=yes \
lt_cv_dlopen_self=yes \
--with-yielding-select=yes \
--enable-dynamic \
--enable-crypt \
--with-tls=gnutls \
--with-cyrus-sasl \
--enable-otp \
--with-argon2=libargon2 \
--enable-argon2 \
--enable-ppolicy \
--enable-remoteauth \
--prefix=/opt/openldap \
--enable-modules \
--enable-ipv6 \
--enable-asyncmeta=mod \
--enable-mdb=yes \
--enable-ldap=mod \
--enable-meta=mod \
--enable-null=mod \
--enable-passwd=mod \
--enable-proxycache=mod \
--enable-dnssrv=mod
else
export LDFLAGS="-L/opt/gnutls/lib -Wl,-rpath,/opt/gnutls/lib"
./configure \
--with-tls=gnutls \
--with-cyrus-sasl \
--enable-otp \
--with-argon2=libargon2 \
--enable-argon2 \
--enable-ppolicy \
--enable-remoteauth \
--prefix=/opt/openldap \
--enable-modules
fi
- name: Build OpenLDAP
working-directory: openldap
run: |
make depend
make -j$(nproc)
- name: Test OpenLDAP
working-directory: openldap
run: |
make test