Actions: CMake
Build on various os versions
-name: C/C++ CI
+name: Build
on: [push, pull_request]
jobs:
- build:
+ linux:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [macos-latest, ubuntu-16.04]
+ os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
+ fail-fast: false
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
+
- name: Install build tools
- if: matrix.os == 'macos-latest'
- run: brew install autoconf automake libtool pkg-config
- - name: bootstrap and configure
- run: ./bootstrap && ./configure --enable-debug
- - name: make
- run: make
- - name: make distcheck
- run: make VERBOSE=1 distcheck
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y ninja-build
+
+ - name: Build
+ run: |
+ mkdir ../build
+ cd ../build
+ cmake -G Ninja -DBUILD_TESTING=ONs ../pupnp
+ ninja
+
+ - name: Test
+ run: |
+ cd ../build
+ ctest --output-on-failure
+
+ windows:
+ name: Build (${{ matrix.os }})
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: [windows-2016, windows-2019]
+ fail-fast: false
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install build tools
+ run: |
+ choco install ninja vswhere
+
+ - name: Build
+ run: |
+ $installationPath = vswhere.exe -prerelease -latest -property installationPath
+ if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
+ & "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object {
+ $name, $value = $_ -split '=', 2
+ set-content env:\"$name" $value
+ }
+ }
+ mkdir ../build
+ cd ../build
+ cmake -G Ninja -DDOWNLOAD_AND_BUILD_DEPS=ON -DBUILD_TESTING=ON ../pupnp
+ ninja
+
+ - name: Test
+ run: |
+ cd ../build
+ ctest -E pthread4w --output-on-failure # Exclude pthread4w tests on windows
+
+ macos:
+ name: Build (${{ matrix.os }})
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: [macos-10.13, macos-10.15, macos-11.0]
+ fail-fast: false
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install build tools
+ run: brew install pkg-config cmake ninja
+
+ - name: Build
+ run: |
+ mkdir ../build
+ cd ../build
+ cmake -G Ninja -DBUILD_TESTING=ON ../pupnp
+ ninja
+
+ - name: Test
+ run: |
+ cd ../build
+ ctest --output-on-failure
build_asan:
- name: Sanitizer build (ubuntu-16.04)
- runs-on: ubuntu-16.04
+ name: Sanitizer build (ubuntu-20.04)
+ runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
