|
| 1 | +name: OpenLDAP Test |
| 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_gnutls: |
| 17 | + name: Build wolfSSL, GnuTLS and provider |
| 18 | + timeout-minutes: 30 |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + os: [ ubuntu-latest ] |
| 22 | + openldap_ref: [ 'master', 'OPENLDAP_REL_ENG_2_5_13', 'OPENLDAP_REL_ENG_2_6_9' ] |
| 23 | + fail-fast: false |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout gnutls-wolfssl repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Ensure make available (Ubuntu only) |
| 31 | + if: matrix.os == 'ubuntu-latest' |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y build-essential |
| 35 | +
|
| 36 | + - name: Install GnuTLS dependencies (Ubuntu only) |
| 37 | + if: matrix.os == 'ubuntu-latest' |
| 38 | + run: | |
| 39 | + sudo 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 |
| 40 | +
|
| 41 | + - name: Install OpenLDAP dependencies (Ubuntu only) |
| 42 | + if: matrix.os == 'ubuntu-latest' |
| 43 | + run: | |
| 44 | + sudo apt-get install -y libsasl2-dev libsasl2-modules libsasl2-modules-gssapi-mit libargon2-dev groff-base |
| 45 | +
|
| 46 | + - name: Build GnuTLS with wolfSSL provider using setup.sh script |
| 47 | + run: | |
| 48 | + echo "Running setup.sh..." |
| 49 | + BUILD_RESULT=0 |
| 50 | + GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh |
| 51 | + if [ $? -ne 0 ]; then |
| 52 | + echo "Build failed" |
| 53 | + exit 1 |
| 54 | + fi |
| 55 | +
|
| 56 | + - name: Check setup.sh output directories |
| 57 | + run: | |
| 58 | + echo "Check for wolfSSL installation..." |
| 59 | + if [ ! -d /opt/wolfssl ]; then |
| 60 | + echo "/opt/wolfssl not found after setup" |
| 61 | + exit 1 |
| 62 | + fi |
| 63 | + echo "Check for GnuTLS installation..." |
| 64 | + if [ ! -d /opt/gnutls ]; then |
| 65 | + echo "/opt/gnutls not found after setup" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | + echo "Check for wrapper installation..." |
| 69 | + if [ ! -d /opt/wolfssl-gnutls-wrapper/lib ]; then |
| 70 | + echo "/opt/wolfssl-gnutls-wrapper/lib not found after setup" |
| 71 | + exit 1 |
| 72 | + fi |
| 73 | +
|
| 74 | + - name: Build OpenLDAP at ${{ matrix.openldap_ref }} |
| 75 | + run: | |
| 76 | + git clone https://git.openldap.org/openldap/openldap.git |
| 77 | + cd openldap |
| 78 | + if [ "${{ matrix.openldap_ref }}" != "master" ]; then |
| 79 | + git checkout ${{ matrix.openldap_ref }} |
| 80 | + fi |
| 81 | +
|
| 82 | + - name: Configure OpenLDAP |
| 83 | + working-directory: openldap |
| 84 | + run: | |
| 85 | + export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig |
| 86 | + export CPPFLAGS=-I/opt/gnutls/include |
| 87 | + export LDFLAGS="-L/opt/gnutls/lib -Wl,-rpath,/opt/gnutls/lib" |
| 88 | + ./configure \ |
| 89 | + --with-tls=gnutls \ |
| 90 | + --with-cyrus-sasl \ |
| 91 | + --enable-otp \ |
| 92 | + --with-argon2=libargon2 \ |
| 93 | + --enable-argon2 \ |
| 94 | + --enable-ppolicy \ |
| 95 | + --enable-remoteauth \ |
| 96 | + --prefix=/opt/openldap \ |
| 97 | + --enable-modules |
| 98 | +
|
| 99 | + - name: Build OpenLDAP |
| 100 | + working-directory: openldap |
| 101 | + run: | |
| 102 | + make depend |
| 103 | + make |
| 104 | +
|
| 105 | + - name: Test OpenLDAP |
| 106 | + working-directory: openldap |
| 107 | + run: | |
| 108 | + WGW_LOGGING=0 make test |
0 commit comments