Skip to content

Commit

Permalink
Merge 4c08773 into 4108a5d
Browse files Browse the repository at this point in the history
  • Loading branch information
gummif committed Jul 15, 2021
2 parents 4108a5d + 4c08773 commit 603af06
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -18,7 +18,6 @@ jobs:
drafts: ["ON"]
libzmq: ["4.3.4"]
libzmqbuild: ["cmake"]
platform: [""]
include:
# older libzmq and gcc without draft
- os: "ubuntu-18.04"
Expand Down Expand Up @@ -54,6 +53,15 @@ jobs:
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# coverage (gcc version should match gcov version)
- os: "ubuntu-latest"
cppstd: "17"
cc: "gcc-9"
cxx: "g++-9"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
coverage: "-DCOVERAGE=ON"
# clang
- os: "ubuntu-latest"
cppstd: "17"
Expand Down Expand Up @@ -126,10 +134,9 @@ jobs:
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
run: |
cmake -H. -Bbuild ${{ matrix.platform}} \
cmake -H. -Bbuild ${{ matrix.platform}} ${{ matrix.coverage }} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DENABLE_DRAFTS=${{ matrix.drafts }} \
-DCOVERAGE=${COVERAGE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE} -j ${THREADS}
echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
Expand All @@ -154,3 +161,22 @@ jobs:
cmake --build build --config ${BUILDTYPE}
cd build
ctest -V -C ${BUILDTYPE}
- name: lcov
if: ${{ matrix.coverage && success() }}
run: |
sudo apt install -y lcov
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info -o coverage_filtered.info \
'/usr/include/*' \
'/usr/local/include/*' \
${PWD}'/tests/*' \
${PWD}'/build/*'
# to generate local html: genhtml coverage_filtered.info --output-directory .

- name: coveralls_upload
if: ${{ matrix.coverage && success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage_filtered.info
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Expand Up @@ -44,7 +44,8 @@ OPTION (COVERAGE "Enable gcda file generation needed by lcov" OFF)

if (COVERAGE)
target_compile_options(unit_tests PRIVATE --coverage)
target_link_libraries(unit_tests PRIVATE --coverage)
target_link_options(unit_tests PRIVATE --coverage)
message(STATUS "Coverage enabled")
endif()

include(CTest)
Expand Down

0 comments on commit 603af06

Please sign in to comment.