|
| 1 | +name: Nginx 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-${{ matrix.wolfssl_ref }}-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 | + |
| 54 | + # If not yet built this version, build it now |
| 55 | + - name: Build wolfProvider |
| 56 | + if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true' |
| 57 | + run: | |
| 58 | + WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh |
| 59 | + make check |
| 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_nginx: |
| 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 | + matrix: |
| 75 | + nginx_ref: [ 'master', 'release-1.27.4' ] |
| 76 | + wolfssl_ref: [ 'master', 'v5.7.4-stable' ] |
| 77 | + steps: |
| 78 | + - name: Retrieving OpenSSL from cache |
| 79 | + uses: actions/cache/restore@v4 |
| 80 | + id: openssl-cache |
| 81 | + with: |
| 82 | + path: | |
| 83 | + openssl-source |
| 84 | + openssl-install |
| 85 | +
|
| 86 | + key: ossl-depends |
| 87 | + fail-on-cache-miss: true |
| 88 | + |
| 89 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 90 | + uses: actions/cache/restore@v4 |
| 91 | + id: wolfprov-cache |
| 92 | + with: |
| 93 | + path: | |
| 94 | + wolfssl-source |
| 95 | + wolfssl-install |
| 96 | + wolfprov-install |
| 97 | + provider.conf |
| 98 | +
|
| 99 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 100 | + fail-on-cache-miss: true |
| 101 | + |
| 102 | + - name: Install nginx dependencies |
| 103 | + run: | |
| 104 | + sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL |
| 105 | +
|
| 106 | + - name: Checkout nginx |
| 107 | + uses: actions/checkout@v4 |
| 108 | + with: |
| 109 | + repository: nginx/nginx |
| 110 | + path: nginx |
| 111 | + ref: ${{ matrix.nginx_ref }} |
| 112 | + |
| 113 | + - name: Build nginx |
| 114 | + working-directory: nginx |
| 115 | + run: | |
| 116 | + ./auto/configure --with-http_ssl_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --with-mail --with-mail_ssl_module |
| 117 | + make -j |
| 118 | +
|
| 119 | + - name: Checkout nginx-tests |
| 120 | + uses: actions/checkout@v4 |
| 121 | + with: |
| 122 | + repository: nginx/nginx-tests |
| 123 | + path: nginx-tests |
| 124 | + ref: master |
| 125 | + |
| 126 | + - name: Run nginx-tests with wolfProvider |
| 127 | + working-directory: nginx-tests |
| 128 | + run: | |
| 129 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64 |
| 130 | + export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf |
| 131 | + export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib |
| 132 | + TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y TEST_NGINX_BINARY=../nginx/objs/nginx prove -v . |
0 commit comments