|
| 1 | +name: liboauth2 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 | + uses: ./.github/workflows/build-wolfprovider.yml |
| 18 | + with: |
| 19 | + wolfssl_ref: ${{ matrix.wolfssl_ref }} |
| 20 | + openssl_ref: ${{ matrix.openssl_ref }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 24 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 25 | + |
| 26 | + test_liboauth2: |
| 27 | + runs-on: ubuntu-22.04 |
| 28 | + needs: build_wolfprovider |
| 29 | + timeout-minutes: 20 |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + liboauth2_ref: [ 'v1.4.5.4' ] # No master with patch |
| 33 | + wolfssl_ref: [ 'master', 'v5.8.0-stable' ] |
| 34 | + openssl_ref: [ 'openssl-3.5.0' ] |
| 35 | + force_fail: ['WOLFPROV_FORCE_FAIL=1', ''] |
| 36 | + steps: |
| 37 | + - name: Checkout wolfProvider |
| 38 | + uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Retrieving OpenSSL from cache |
| 41 | + uses: actions/cache/restore@v4 |
| 42 | + id: openssl-cache |
| 43 | + with: |
| 44 | + path: | |
| 45 | + openssl-source |
| 46 | + openssl-install |
| 47 | +
|
| 48 | + key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }} |
| 49 | + fail-on-cache-miss: true |
| 50 | + |
| 51 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 52 | + uses: actions/cache/restore@v4 |
| 53 | + id: wolfprov-cache |
| 54 | + with: |
| 55 | + path: | |
| 56 | + wolfssl-source |
| 57 | + wolfssl-install |
| 58 | + wolfprov-install |
| 59 | + provider.conf |
| 60 | +
|
| 61 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 62 | + fail-on-cache-miss: true |
| 63 | + |
| 64 | + - name: Install liboauth2 dependencies |
| 65 | + run: | |
| 66 | + sudo apt-get update |
| 67 | + sudo apt-get install -y libssl-dev libcurl4-openssl-dev libjansson-dev \ |
| 68 | + libcjose-dev pkg-config build-essential apache2-dev libhiredis-dev \ |
| 69 | + libmemcached-dev autotools-dev autoconf automake libtool check |
| 70 | +
|
| 71 | + - name: Checkout OSP |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + repository: wolfssl/osp |
| 75 | + path: osp |
| 76 | + |
| 77 | + - name: Build liboauth2 |
| 78 | + run: | |
| 79 | + git clone https://github.com/OpenIDC/liboauth2.git |
| 80 | + cd liboauth2 |
| 81 | + git checkout ${{ matrix.liboauth2_ref }} |
| 82 | + patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/liboauth2/liboauth2-${{ matrix.liboauth2_ref }}-wolfprov.patch |
| 83 | +
|
| 84 | + autoreconf -fiv |
| 85 | + ./configure |
| 86 | + make -j$(nproc) |
| 87 | +
|
| 88 | + - name: Run liboauth2 tests |
| 89 | + working-directory: liboauth2 |
| 90 | + run: | |
| 91 | + # Set environment variables |
| 92 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64 |
| 93 | + export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf |
| 94 | + export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib |
| 95 | + export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/openssl-install/lib64/pkgconfig |
| 96 | + export ${{ matrix.force_fail }} |
| 97 | +
|
| 98 | + # Build and run tests |
| 99 | + make check 2>&1 | tee liboauth2-test.log |
| 100 | + TEST_RESULT=$? |
| 101 | + $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} liboauth2 |
0 commit comments