2020-07-18 06:21:44 +08:00
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-08-01 20:28:24 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
compiler: [g++, clang++]
|
2020-08-01 20:50:14 +08:00
|
|
|
build_type: [Release, Debug]
|
|
|
|
name: Build and run tests (${{ matrix.compiler }}, ${{ matrix.build_type }})
|
2020-07-18 07:26:08 +08:00
|
|
|
timeout-minutes: 10
|
2020-07-18 06:21:44 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2020-07-18 07:33:33 +08:00
|
|
|
env:
|
2020-08-01 20:28:24 +08:00
|
|
|
CXX: ${{ matrix.compiler }}
|
2020-07-18 06:21:44 +08:00
|
|
|
steps:
|
2021-05-18 08:42:42 +08:00
|
|
|
- name: Install clang++-12
|
|
|
|
if: ${{ matrix.compiler == 'clang++' }}
|
|
|
|
uses: KyleMayes/install-llvm-action@v1.3.0
|
|
|
|
with:
|
|
|
|
version: "12.0.0"
|
|
|
|
directory: ${{ runner.temp }}/llvm
|
2021-05-18 08:40:04 +08:00
|
|
|
- name: Info
|
|
|
|
run: cmake --version && $CXX --version && uname -a
|
2020-07-18 06:21:44 +08:00
|
|
|
- uses: actions/checkout@v2
|
2020-07-18 06:40:00 +08:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: catchorg/Catch2
|
2021-05-18 02:07:45 +08:00
|
|
|
ref: v2.x
|
2020-07-18 06:40:00 +08:00
|
|
|
path: catch
|
|
|
|
- name: Install catch
|
|
|
|
working-directory: catch
|
|
|
|
run: >
|
|
|
|
mkdir build
|
|
|
|
&& cd build
|
|
|
|
&& cmake -DCMAKE_BUILD_TYPE=Release -DCATCH_BUILD_TESTING=Off ..
|
|
|
|
&& sudo make install
|
2020-07-18 07:33:33 +08:00
|
|
|
- name: Build
|
2020-07-18 06:21:44 +08:00
|
|
|
run: >
|
2020-07-18 06:26:01 +08:00
|
|
|
mkdir -p build
|
2020-07-18 06:21:44 +08:00
|
|
|
&& cd build
|
2020-08-01 20:50:14 +08:00
|
|
|
&& cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
|
2020-07-18 06:21:44 +08:00
|
|
|
&& make
|
2020-07-18 07:33:33 +08:00
|
|
|
- name: Build Test
|
|
|
|
run: cd build && make sgnl-test
|
|
|
|
- name: Run Test
|
2020-08-01 20:29:08 +08:00
|
|
|
run: ./build/test/sgnl-test
|
2020-07-18 07:33:33 +08:00
|
|
|
- name: Build example
|
|
|
|
run: >
|
|
|
|
cd build
|
2020-07-18 06:21:44 +08:00
|
|
|
&& make example
|
2020-07-18 07:33:33 +08:00
|
|
|
- name: Run example
|
|
|
|
run: ./build/example
|
|
|
|
- name: Install signal-wrangler
|
2020-07-18 07:34:42 +08:00
|
|
|
run: cd build && sudo make install
|
2020-07-18 07:33:33 +08:00
|
|
|
- name: Test install
|
2020-07-18 07:34:42 +08:00
|
|
|
run: >
|
2020-07-18 07:33:33 +08:00
|
|
|
cd example
|
2020-07-18 06:21:44 +08:00
|
|
|
&& $CXX -std=c++17 -Wall -pthread -o example example.cpp
|
|
|
|
&& ./example
|