Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
config:
- name: Ubuntu Latest (GCC)
os: ubuntu-latest
build_type: Release
build_type: Debug
test_path: CommonTest
cc: gcc
cxx: g++
code_coverage: true

- name: macOS Latest (Clang)
os: macos-latest
Expand All @@ -41,10 +42,22 @@ jobs:
run: mkdir build

- name: Configure
run: cd build && cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
working-directory: ./build
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCODE_COVERAGE=${{ matrix.config.code_coverage && 'ON' || 'OFF' }}

- name: Build
run: cmake --build build --config ${{ matrix.config.build_type }}
working-directory: ./build
run: cmake --build . --config ${{ matrix.config.build_type }}

- name: Test
run: ./build/test/${{ matrix.config.test_path }}
working-directory: ./build
run: ./test/${{ matrix.config.test_path }}

- name: Upload coverage
uses: codecov/codecov-action@v3
if: ${{ matrix.config.code_coverage }}
with:
verbose: true
gcov: true
gcov_ignore:
/usr/include*
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set(CMAKE_CXX_STANDARD 11)

include(lib/system/cmake/system.cmake)

option(CODE_COVERAGE "Enable code coverage instrumentation" OFF)

add_subdirectory(lib)
add_subdirectory(common)
add_subdirectory(test)
Expand Down
5 changes: 5 additions & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ target_link_libraries(common
storm
tempest
)

if(CODE_COVERAGE)
target_compile_options(common PRIVATE --coverage)
target_link_options(common PUBLIC --coverage)
endif()