Skip to content

Build system switched to cmake (#17) #15

Build system switched to cmake (#17)

Build system switched to cmake (#17) #15

Workflow file for this run

name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
build_type: [Release, Debug]
runs-on: ubuntu-latest
env:
BUILD_DIR: ${{github.workspace}}/build/${{matrix.build_type}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
run: cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}}
- name: Test
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{env.BUILD_TYPE}}
- name: Generate coverage report
if: ${{matrix.build_type == 'Debug'}}
working-directory: ${{github.workspace}}
run: |
sudo apt-get install lcov
lcov --base-directory . --directory ${{env.BUILD_DIR}} -c -o coverage.info
lcov --remove coverage.info "test/*" -o coverage.info
- name: Upload coverage to Codecov
if: ${{matrix.build_type == 'Debug'}}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
files: coverage.info