build-with-cmake.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Build with CMake
  2. on:
  3. push:
  4. branches: [ master, github-actions ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. platform: [ubuntu-latest, macos-latest, windows-latest]
  12. cmake_build_type: [Debug, RelWithDebInfo]
  13. sctp_invariants: [ON, OFF]
  14. sctp_inet6: [ON, OFF]
  15. sctp_inet: [ON, OFF]
  16. sctp_debug: [ON, OFF]
  17. runs-on: ${{ matrix.platform }}
  18. steps:
  19. - uses: actions/checkout@v2
  20. with:
  21. path: 'usrsctp_source'
  22. - name: Prepare dirs
  23. shell: bash
  24. run: |
  25. mkdir -p cmake_build
  26. mkdir -p cmake_install
  27. - name: Generate CMake project
  28. shell: bash
  29. run: |
  30. cd cmake_build
  31. cmake -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
  32. -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  33. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
  34. -Dsctp_debug=${{ matrix.sctp_debug }} \
  35. -Dsctp_invariants=${{ matrix.sctp_invariants }} \
  36. -Dsctp_inet6=${{ matrix.sctp_inet6 }} \
  37. -Dsctp_inet=${{ matrix.sctp_inet }} \
  38. -Dsctp_build_programs=ON \
  39. -Dsctp_build_fuzzer=OFF \
  40. -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/cmake_install \
  41. ${GITHUB_WORKSPACE}/usrsctp_source
  42. - name: Build and install project
  43. shell: bash
  44. run: |
  45. cmake --build cmake_build \
  46. --parallel 2 \
  47. --config ${{ matrix.cmake_build_type }} \
  48. --target install \
  49. --clean-first