Skip to content

Commit e965157

Browse files
authored
Merge pull request #104 from aidangarske/openldap-workflow
openldap.yml - CI github workflow
2 parents 1308aec + 9817b8a commit e965157

File tree

1 file changed

+141
-0
lines changed

1 file changed

+141
-0
lines changed

.github/workflows/openldap.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: OpenLDAP Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
name: Build wolfProvider
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 20
20+
strategy:
21+
matrix:
22+
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
steps:
24+
- name: Checkout wolfProvider
25+
uses: actions/checkout@v4
26+
27+
# Check if this version of wolfssl/wolfprovider has already been built,
28+
# mark to cache these items on post if we do end up building
29+
- name: Checking wolfSSL/wolfProvider in cache
30+
uses: actions/cache@v4
31+
id: wolfprov-cache
32+
with:
33+
path: |
34+
wolfssl-source
35+
wolfssl-install
36+
wolfprov-install
37+
provider.conf
38+
39+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
40+
lookup-only: true
41+
42+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
43+
- name: Checking OpenSSL in cache
44+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
45+
uses: actions/cache@v4
46+
id: openssl-cache
47+
with:
48+
path: |
49+
openssl-source
50+
openssl-install
51+
52+
key: ossl-depends
53+
fail-on-cache-miss: false
54+
55+
# If not yet built this version, build it now
56+
- name: Build wolfProvider
57+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
58+
run: |
59+
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
60+
61+
- name: Print errors
62+
if: ${{ failure() }}
63+
run: |
64+
if [ -f test-suite.log ] ; then
65+
cat test-suite.log
66+
fi
67+
68+
test_openldap:
69+
runs-on: ubuntu-22.04
70+
needs: build_wolfprovider
71+
# This should be a safe limit for the tests to run.
72+
timeout-minutes: 20
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
include:
77+
# List of releases to test
78+
- osp_ref: 2.5.13
79+
git_ref: OPENLDAP_REL_ENG_2_5_13
80+
- osp_ref: 2.6.7
81+
git_ref: OPENLDAP_REL_ENG_2_6_7
82+
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
83+
steps:
84+
- name: Retrieving OpenSSL from cache
85+
uses: actions/cache/restore@v4
86+
id: openssl-cache
87+
with:
88+
path: |
89+
openssl-source
90+
openssl-install
91+
92+
key: ossl-depends
93+
fail-on-cache-miss: false
94+
95+
- name: Retrieving wolfSSL/wolfProvider from cache
96+
uses: actions/cache/restore@v4
97+
id: wolfprov-cache
98+
with:
99+
path: |
100+
wolfssl-source
101+
wolfssl-install
102+
wolfprov-install
103+
provider.conf
104+
105+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
106+
fail-on-cache-miss: true
107+
108+
- name: Install dependencies
109+
run: |
110+
sudo apt-get update
111+
sudo apt-get install -y libsasl2-dev
112+
113+
- name: Checkout openldap
114+
uses: actions/checkout@v4
115+
with:
116+
repository: openldap/openldap
117+
path: openldap
118+
ref: ${{ matrix.git_ref }}
119+
120+
- name: Build and test OpenLDAP with wolfProvider
121+
working-directory: openldap
122+
run: |
123+
# Setup environment for wolfProvider
124+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
125+
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
126+
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
127+
128+
# Generate configure script
129+
rm -f aclocal.m4
130+
autoreconf -ivf
131+
132+
# Configure with OpenSSL
133+
./configure --with-tls=openssl --disable-bdb --disable-hdb \
134+
CFLAGS="-I$GITHUB_WORKSPACE/openssl-install/include \
135+
-L$GITHUB_WORKSPACE/openssl-install/lib64" \
136+
LDFLAGS="-Wl,-rpath,$GITHUB_WORKSPACE/openssl-install/lib64"
137+
138+
# Build OpenLDAP
139+
make -j depend
140+
make -j
141+
make -j check

0 commit comments

Comments
 (0)