2020-03-21 09:59:32 +00:00
|
|
|
name: C/C++ CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2020-04-26 19:19:59 +00:00
|
|
|
job:
|
|
|
|
name: ${{ matrix.os }}-build-and-test
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
# For Windows msvc, for Linux and macOS let's use the clang compiler
|
|
|
|
include:
|
|
|
|
- os: windows-latest
|
|
|
|
cxx: cl.exe
|
|
|
|
cc: cl.exe
|
|
|
|
- os: ubuntu-latest
|
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
|
|
|
- os: macos-latest
|
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
|
|
|
|
2020-03-21 09:59:32 +00:00
|
|
|
steps:
|
2020-04-15 14:29:55 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-29 15:55:28 +00:00
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
- uses: lukka/get-cmake@latest
|
2020-03-29 16:39:55 +00:00
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
|
|
|
- uses: lukka/set-shell-env@v1
|
|
|
|
with:
|
|
|
|
CXX: ${{ matrix.cxx }}
|
|
|
|
CC: ${{ matrix.cc }}
|
|
|
|
|
|
|
|
- name: configure and build
|
|
|
|
uses: lukka/run-cmake@v2
|
|
|
|
with:
|
|
|
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
|
|
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
|
|
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release'
|
|
|
|
buildWithCMakeArgs: '-- -v'
|
|
|
|
buildDirectory: '${{ github.workspace }}/build/'
|
|
|
|
|
2020-03-29 16:39:55 +00:00
|
|
|
- name: test
|
2020-04-26 19:19:59 +00:00
|
|
|
run: cd build/bin && ./unit
|
|
|
|
shell: bash
|