cmake.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: CMake
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. strategy:
  6. fail-fast: false
  7. matrix:
  8. os: [ubuntu-latest, macos-latest, windows-latest]
  9. crypto: [internal, openssl, nss, mbedtls]
  10. exclude:
  11. - os: windows-latest
  12. crypto: openssl
  13. - os: windows-latest
  14. crypto: nss
  15. - os: windows-latest
  16. crypto: mbedtls
  17. include:
  18. - crypto: internal
  19. cmake-crypto-enable: ""
  20. - crypto: openssl
  21. cmake-crypto-enable: "-DENABLE_OPENSSL=ON"
  22. - crypto: nss
  23. cmake-crypto-enable: "-DENABLE_NSS=ON"
  24. - crypto: mbedtls
  25. cmake-crypto-enable: "-DENABLE_MBEDTLS=ON"
  26. runs-on: ${{ matrix.os }}
  27. env:
  28. CTEST_OUTPUT_ON_FAILURE: 1
  29. steps:
  30. - name: Setup Ubuntu NSS
  31. if: matrix.os == 'ubuntu-latest' && matrix.crypto == 'nss'
  32. run: sudo apt-get install libnss3-dev
  33. - name: Setup Ubuntu MbedTLS
  34. if: matrix.os == 'ubuntu-latest' && matrix.crypto == 'mbedtls'
  35. run: sudo apt-get install libmbedtls-dev
  36. - name: Setup macOS OpenSSL
  37. if: matrix.os == 'macos-latest' && matrix.crypto == 'openssl'
  38. run: echo "cmake-crypto-dir=-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1)" >> $GITHUB_ENV
  39. - name: Setup macOS NSS
  40. if: matrix.os == 'macos-latest' && matrix.crypto == 'nss'
  41. run: brew install nss
  42. - name: Setup macOS MbedTLS
  43. if: matrix.os == 'macos-latest' && matrix.crypto == 'mbedtls'
  44. run: brew install mbedtls
  45. - uses: actions/checkout@v2
  46. - name: Create Build Environment
  47. run: cmake -E make_directory ${{github.workspace}}/build
  48. - name: Configure CMake
  49. working-directory: ${{github.workspace}}/build
  50. shell: bash
  51. run: cmake $GITHUB_WORKSPACE -DBUILD_WITH_SANITIZERS=TRUE ${{ matrix.cmake-crypto-enable}} ${{env.cmake-crypto-dir}}
  52. - name: Build
  53. working-directory: ${{github.workspace}}/build
  54. shell: bash
  55. run: cmake --build .
  56. - name: Test
  57. working-directory: ${{github.workspace}}/build
  58. shell: bash
  59. run: ctest