|
| 1 | +name: xmlsec test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**' ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + build_gnutls: |
| 15 | + name: Build wolfSSL, GnuTLS and provider |
| 16 | + timeout-minutes: 20 |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + os: [ ubuntu-24.04 ] |
| 20 | + xmlsec_ref: [ 'master', '1.3.4', '1.3.9' ] |
| 21 | + fail-fast: false |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo apt-get install -y build-essential gnulib autopoint gperf gtk-doc-tools nettle-dev clang \ |
| 32 | + libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev \ |
| 33 | + wget git flex autoconf-archive libhttp-daemon-perl ninja-build automake \ |
| 34 | + autoconf libtool libtool-bin gcc \ |
| 35 | + libxml2 libxml2-dev libxslt1.1 libxslt1-dev \ |
| 36 | + help2man man2html gtk-doc-tools |
| 37 | +
|
| 38 | + - name: Restore cached gnutls-wolfssl |
| 39 | + id: cache-gnutls |
| 40 | + uses: actions/cache@v4 |
| 41 | + with: |
| 42 | + path: | |
| 43 | + ~/cache/gnutls |
| 44 | + ~/cache/wolfssl |
| 45 | + ~/cache/wolfssl-gnutls-wrapper |
| 46 | + key: gnutls-wolfssl-${{ runner.os }}-${{ hashFiles('setup.sh', 'wolfssl-gnutls-wrapper/**', 'wolfssl/**', 'gnutls/**') }} |
| 47 | + restore-keys: | |
| 48 | + gnutls-wolfssl-${{ runner.os }}- |
| 49 | +
|
| 50 | + - name: Copy cache to /opt |
| 51 | + if: steps.cache-gnutls.outputs.cache-hit == 'true' |
| 52 | + run: | |
| 53 | + sudo mkdir -p /opt |
| 54 | + sudo cp -a ~/cache/gnutls /opt/ |
| 55 | + sudo cp -a ~/cache/wolfssl /opt/ |
| 56 | + sudo cp -a ~/cache/wolfssl-gnutls-wrapper /opt/ |
| 57 | + echo "Cache restored successfully" |
| 58 | +
|
| 59 | + - name: Build GnuTLS with wolfSSL provider using setup.sh script |
| 60 | + if: steps.cache-gnutls.outputs.cache-hit != 'true' |
| 61 | + run: | |
| 62 | + echo "Cache miss - running setup.sh..." |
| 63 | + GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh |
| 64 | + # Save to cache location |
| 65 | + mkdir -p ~/cache |
| 66 | + sudo cp -a /opt/gnutls ~/cache/ |
| 67 | + sudo cp -a /opt/wolfssl ~/cache/ |
| 68 | + sudo cp -a /opt/wolfssl-gnutls-wrapper ~/cache/ |
| 69 | + sudo chown -R $(id -u):$(id -g) ~/cache |
| 70 | +
|
| 71 | + - name: Check setup.sh output directories |
| 72 | + run: | |
| 73 | + echo "Check for wolfSSL installation..." |
| 74 | + ls -la /opt/wolfssl || { echo "/opt/wolfssl not found"; exit 1; } |
| 75 | + echo "Check for GnuTLS installation..." |
| 76 | + ls -la /opt/gnutls || { echo "/opt/gnutls not found"; exit 1; } |
| 77 | + echo "Check for wrapper installation..." |
| 78 | + ls -la /opt/wolfssl-gnutls-wrapper/lib || { echo "/opt/wolfssl-gnutls-wrapper/lib not found"; exit 1; } |
| 79 | +
|
| 80 | + - name: Clone xmlsec |
| 81 | + run: | |
| 82 | + git clone https://github.com/lsh123/xmlsec.git |
| 83 | +
|
| 84 | + - name: Setup and build xmlsec |
| 85 | + working-directory: xmlsec |
| 86 | + run: | |
| 87 | + if [[ "${{ matrix.xmlsec_ref }}" != "master" ]]; then |
| 88 | + git checkout ${{ matrix.xmlsec_ref }} |
| 89 | + fi |
| 90 | + export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig:$PKG_CONFIG_PATH |
| 91 | + ./autogen.sh |
| 92 | + ./configure --with-gnutls=/opt/gnutls \ |
| 93 | + --disable-dsa \ |
| 94 | + --enable-sha1 \ |
| 95 | + --enable-sha224 \ |
| 96 | + --enable-sha256 \ |
| 97 | + --enable-sha384 \ |
| 98 | + --enable-sha512 \ |
| 99 | + --enable-sha3 \ |
| 100 | + --enable-ripemd160 \ |
| 101 | + --enable-hmac \ |
| 102 | + --enable-rsa \ |
| 103 | + --enable-ec \ |
| 104 | + --enable-x509 \ |
| 105 | + --enable-aes \ |
| 106 | + --disable-des \ |
| 107 | + --enable-dh \ |
| 108 | + --enable-pbkdf2 \ |
| 109 | + --enable-concatkdf \ |
| 110 | + --enable-xmldsig \ |
| 111 | + --enable-xmlenc \ |
| 112 | + --enable-pedantic \ |
| 113 | + --enable-debugging |
| 114 | + make -j9 |
| 115 | +
|
| 116 | + - name: Test xmlsec |
| 117 | + working-directory: xmlsec |
| 118 | + run: | |
| 119 | + export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig:$PKG_CONFIG_PATH |
| 120 | + make check |
0 commit comments