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