grpc.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. name: grpc Tests
  2. # START OF COMMON SECTION
  3. on:
  4. push:
  5. branches: [ 'master', 'main', 'release/**' ]
  6. pull_request:
  7. branches: [ '*' ]
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.ref }}
  10. cancel-in-progress: true
  11. # END OF COMMON SECTION
  12. jobs:
  13. build_wolfssl:
  14. name: Build wolfSSL
  15. if: github.repository_owner == 'wolfssl'
  16. # Just to keep it the same as the testing target
  17. runs-on: ubuntu-22.04
  18. # This should be a safe limit for the tests to run.
  19. timeout-minutes: 10
  20. steps:
  21. - name: Build wolfSSL
  22. uses: wolfSSL/actions-build-autotools-project@v1
  23. with:
  24. path: wolfssl
  25. configure: --enable-all 'CPPFLAGS=-DWOLFSSL_RSA_KEY_CHECK -DHAVE_EX_DATA_CLEANUP_HOOKS'
  26. install: true
  27. - name: tar build-dir
  28. run: tar -zcf build-dir.tgz build-dir
  29. - name: Upload built lib
  30. uses: actions/upload-artifact@v4
  31. with:
  32. name: wolf-install-grpc
  33. path: build-dir.tgz
  34. retention-days: 5
  35. grpc_check:
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. include:
  40. - ref: v1.60.0
  41. tests: >-
  42. bad_ssl_alpn_test bad_ssl_cert_test client_ssl_test
  43. crl_ssl_transport_security_test server_ssl_test
  44. ssl_transport_security_test ssl_transport_security_utils_test
  45. test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
  46. h2_ssl_cert_test h2_ssl_session_reuse_test
  47. name: ${{ matrix.ref }}
  48. if: github.repository_owner == 'wolfssl'
  49. runs-on: ubuntu-22.04
  50. # This should be a safe limit for the tests to run.
  51. timeout-minutes: 30
  52. needs: build_wolfssl
  53. steps:
  54. - name: Confirm IPv4 and IPv6 support
  55. run: |
  56. ip addr list lo | grep 'inet '
  57. ip addr list lo | grep 'inet6 '
  58. - name: Install prereqs
  59. run:
  60. sudo apt-get install build-essential autoconf libtool pkg-config cmake clang libc++-dev
  61. - name: Download lib
  62. uses: actions/download-artifact@v4
  63. with:
  64. name: wolf-install-grpc
  65. - name: untar build-dir
  66. run: tar -xf build-dir.tgz
  67. - name: Checkout OSP
  68. uses: actions/checkout@v4
  69. with:
  70. repository: wolfssl/osp
  71. path: osp
  72. - name: Checkout grpc
  73. uses: actions/checkout@v4
  74. with:
  75. repository: grpc/grpc
  76. path: grpc
  77. ref: ${{ matrix.ref }}
  78. - name: Build grpc
  79. working-directory: ./grpc
  80. run: |
  81. patch -p1 < ../osp/grpc/grpc-${{ matrix.ref }}.patch
  82. git submodule update --init
  83. mkdir cmake/build
  84. cd cmake/build
  85. cmake -DgRPC_BUILD_TESTS=ON -DgRPC_SSL_PROVIDER=wolfssl \
  86. -DWOLFSSL_INSTALL_DIR=$GITHUB_WORKSPACE/build-dir ../..
  87. make -j $(nproc) ${{ matrix.tests }}
  88. - name: Run grpc tests
  89. working-directory: ./grpc
  90. run: |
  91. export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
  92. ./tools/run_tests/start_port_server.py
  93. for t in ${{ matrix.tests }} ; do
  94. ./cmake/build/$t
  95. done