nginx.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. name: nginx Tests
  2. on:
  3. push:
  4. workflow_call:
  5. jobs:
  6. build_wolfssl:
  7. name: Build wolfSSL
  8. # Just to keep it the same as the testing target
  9. runs-on: ubuntu-latest
  10. steps:
  11. - if: ${{ runner.debug }}
  12. name: Enable wolfSSL debug logging
  13. run: |
  14. # We don't use --enable-debug since it makes the logs too loud
  15. echo "wolf_debug_flags= CFLAGS='-g3 -O0'" >> $GITHUB_ENV
  16. - name: Build wolfSSL
  17. uses: wolfSSL/actions-build-autotools-project@v1
  18. with:
  19. path: wolfssl
  20. configure: --enable-nginx ${{ env.wolf_debug_flags }}
  21. install: true
  22. - name: Upload built lib
  23. uses: actions/upload-artifact@v3
  24. with:
  25. name: wolf-install-nginx
  26. path: build-dir
  27. retention-days: 1
  28. nginx_check:
  29. strategy:
  30. fail-fast: false
  31. matrix:
  32. include:
  33. # in general we want to pass all tests that match *ssl*
  34. - ref: 1.25.0
  35. test-ref: 5b2894ea1afd01a26c589ce11f310df118e42592
  36. # Following tests pass with sanitizer on
  37. sanitize-ok: >-
  38. h2_ssl_proxy_cache.t h2_ssl.t h2_ssl_variables.t h2_ssl_verify_client.t
  39. mail_imap_ssl.t mail_ssl_conf_command.t mail_ssl_session_reuse.t
  40. mail_ssl.t proxy_ssl_certificate_empty.t proxy_ssl_certificate.t
  41. proxy_ssl_certificate_vars.t proxy_ssl_conf_command.t proxy_ssl_name.t
  42. ssl_certificate_chain.t ssl_certificate_perl.t ssl_certificates.t
  43. ssl_certificate.t ssl_client_escaped_cert.t ssl_conf_command.t
  44. ssl_crl.t ssl_curve.t ssl_engine_keys.t ssl_ocsp.t ssl_password_file.t
  45. ssl_proxy_protocol.t ssl_proxy_upgrade.t ssl_reject_handshake.t
  46. ssl_session_reuse.t ssl_session_ticket_key.t ssl_sni_reneg.t
  47. ssl_sni_sessions.t ssl_sni.t ssl_stapling.t ssl.t ssl_verify_client.t
  48. ssl_verify_depth.t stream_proxy_ssl_certificate.t stream_proxy_ssl_certificate_vars.t
  49. stream_proxy_ssl_conf_command.t stream_proxy_ssl_name_complex.t
  50. stream_proxy_ssl_name.t stream_ssl_certificate.t stream_ssl_conf_command.t
  51. stream_ssl_preread_alpn.t stream_ssl_preread_protocol.t stream_ssl_preread.t
  52. stream_ssl_realip.t stream_ssl_session_reuse.t stream_ssl.t stream_ssl_variables.t
  53. stream_ssl_verify_client.t stream_upstream_zone_ssl.t upstream_zone_ssl.t
  54. uwsgi_ssl_certificate.t uwsgi_ssl_certificate_vars.t uwsgi_ssl.t
  55. uwsgi_ssl_verify.t
  56. # Following tests do not pass with sanitizer on (with OpenSSL too)
  57. sanitize-not-ok: >-
  58. grpc_ssl.t h2_proxy_request_buffering_ssl.t h2_proxy_ssl.t
  59. proxy_request_buffering_ssl.t proxy_ssl_keepalive.t proxy_ssl.t
  60. proxy_ssl_verify.t stream_proxy_protocol_ssl.t stream_proxy_ssl.t
  61. stream_proxy_ssl_verify.t stream_ssl_alpn.t
  62. name: ${{ matrix.ref }}
  63. runs-on: ubuntu-latest
  64. needs: build_wolfssl
  65. steps:
  66. - name: Download lib
  67. uses: actions/download-artifact@v3
  68. with:
  69. name: wolf-install-nginx
  70. path: build-dir
  71. - name: Install dependencies
  72. run: |
  73. sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL
  74. - name: Checkout wolfssl-nginx
  75. uses: actions/checkout@v3
  76. with:
  77. repository: wolfssl/wolfssl-nginx
  78. path: wolfssl-nginx
  79. - name: Checkout nginx
  80. uses: actions/checkout@v3
  81. with:
  82. repository: nginx/nginx
  83. path: nginx
  84. ref: release-${{ matrix.ref }}
  85. - name: Apply nginx patch
  86. working-directory: nginx
  87. run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl.patch
  88. - if: ${{ runner.debug }}
  89. name: Apply nginx debug patch
  90. working-directory: nginx
  91. run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl-debug.patch
  92. - name: Checkout nginx-tests
  93. uses: actions/checkout@v3
  94. with:
  95. repository: nginx/nginx-tests
  96. path: nginx-tests
  97. ref: ${{ matrix.test-ref }}
  98. - name: Apply nginx-tests patch
  99. working-directory: nginx-tests
  100. run: patch -p1 < ../wolfssl-nginx/nginx-tests-patches/*${{ matrix.test-ref }}.patch
  101. - name: Build nginx without sanitizer
  102. working-directory: nginx
  103. run: |
  104. ./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
  105. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  106. --with-http_v2_module --with-mail --with-mail_ssl_module
  107. make -j
  108. - name: Confirm nginx built with wolfSSL
  109. working-directory: nginx
  110. run: ldd objs/nginx | grep wolfssl
  111. - if: ${{ runner.debug }}
  112. name: Run nginx-tests without sanitizer (debug)
  113. working-directory: nginx-tests
  114. run: |
  115. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  116. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
  117. TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-not-ok }}
  118. - if: ${{ !runner.debug }}
  119. name: Run nginx-tests without sanitizer
  120. working-directory: nginx-tests
  121. run: |
  122. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  123. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
  124. prove ${{ matrix.sanitize-not-ok }}
  125. - if: ${{ runner.debug }}
  126. name: Enable wolfSSL debug logging
  127. run: |
  128. echo "nginx_c_flags=-O0" >> $GITHUB_ENV
  129. - name: Build nginx with sanitizer
  130. working-directory: nginx
  131. run: |
  132. ./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
  133. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  134. --with-http_v2_module --with-mail --with-mail_ssl_module \
  135. --with-cc-opt='-fsanitize=address -DNGX_DEBUG_PALLOC=1 -g3 ${{ env.nginx_c_flags }}' \
  136. --with-ld-opt='-fsanitize=address ${{ env.nginx_c_flags }}'
  137. make -j
  138. - name: Confirm nginx built with wolfSSL
  139. working-directory: nginx
  140. run: ldd objs/nginx | grep wolfssl
  141. - if: ${{ runner.debug }}
  142. name: Run nginx-tests with sanitizer (debug)
  143. working-directory: nginx-tests
  144. run: |
  145. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  146. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
  147. TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-ok }}
  148. - if: ${{ !runner.debug }}
  149. name: Run nginx-tests with sanitizer
  150. working-directory: nginx-tests
  151. run: |
  152. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  153. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
  154. prove ${{ matrix.sanitize-ok }}