diff --git a/.github/workflows/xmlsec.yml b/.github/workflows/xmlsec.yml new file mode 100644 index 00000000..7b68e7ef --- /dev/null +++ b/.github/workflows/xmlsec.yml @@ -0,0 +1,108 @@ +name: xmlsec Tests + +# 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_wolfprovider: + uses: ./.github/workflows/build-wolfprovider.yml + with: + wolfssl_ref: ${{ matrix.wolfssl_ref }} + openssl_ref: ${{ matrix.openssl_ref }} + strategy: + matrix: + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] + openssl_ref: [ 'openssl-3.5.0' ] + + test_xmlsec: + runs-on: ubuntu-22.04 + needs: build_wolfprovider + # This should be a safe limit for the tests to run. + timeout-minutes: 20 + strategy: + matrix: + xmlsec_ref: [ 'master', 'xmlsec-1_2_37' ] + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] + openssl_ref: [ 'openssl-3.5.0' ] + force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] + exclude: + - xmlsec_ref: 'master' + force_fail: 'WOLFPROV_FORCE_FAIL=1' + steps: + # Checkout the source so we can run the check-workflow-result script + - name: Checkout wolfProvider + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Retrieving wolfProvider from cache + uses: actions/cache/restore@v4 + id: wolfprov-cache-restore + with: + path: | + wolfssl-install + wolfprov-install + openssl-install/lib64 + openssl-install/include + openssl-install/bin + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} + fail-on-cache-miss: true + + - name: Install xmlsec dependencies + run: | + sudo apt-get update + sudo apt-get install -y automake autoconf libtool libtool-bin \ + libltdl-dev libltdl7 libxml2-dev + + - name: Checkout OSP + uses: actions/checkout@v4 + with: + repository: wolfSSL/osp + path: osp + fetch-depth: 1 + + - name: Download xmlsec + uses: actions/checkout@v4 + with: + repository: lsh123/xmlsec + ref: ${{ matrix.xmlsec_ref }} + path: xmlsec + fetch-depth: 1 + + - name: Build xmlsec + working-directory: xmlsec + env: + XMLSEC_REF: ${{ matrix.xmlsec_ref }} + run: | + patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/xmlsec/xmlsec-${{ matrix.xmlsec_ref }}-wolfprov.patch + ./autogen.sh --disable-openssl3-engines --disable-dsa --without-nss \ + --without-gnutls --without-gcrypt --disable-xmldsig \ + --disable-crypto-dl --disable-apps-crypto-dl \ + --disable-concatkdf --disable-tmpl-tests + make + cp $GITHUB_WORKSPACE/provider.conf tests/openssl3.cnf + + - name: Run xmlsec tests + working-directory: xmlsec + run: | + echo "Setting environment variables..." + source $GITHUB_WORKSPACE/scripts/env-setup + export ${{ matrix.force_fail }} + export OPENSSL_CONF=$PWD/tests/openssl3.cnf + make check-keys | tee xmlsec-keys.log + make check-enc | tee xmlsec-enc.log + if grep -q "TOTAL FAILED: 0" xmlsec-enc.log && grep -q "TOTAL FAILED: 0" xmlsec-keys.log; then + TEST_RESULT=0 + else + TEST_RESULT=1 + fi + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} xmlsec