1818 drafts : ["ON"]
1919 libzmq : ["4.3.4"]
2020 libzmqbuild : ["cmake"]
21- platform : [""]
2221 include :
2322 # older libzmq and gcc without draft
2423 - os : " ubuntu-18.04"
5453 drafts : " OFF"
5554 libzmq : " 4.3.4"
5655 libzmqbuild : " cmake"
56+ # coverage (gcc version should match gcov version)
57+ - os : " ubuntu-latest"
58+ cppstd : " 17"
59+ cc : " gcc-9"
60+ cxx : " g++-9"
61+ drafts : " ON"
62+ libzmq : " 4.3.4"
63+ libzmqbuild : " cmake"
64+ coverage : " -DCOVERAGE=ON"
5765 # clang
5866 - os : " ubuntu-latest"
5967 cppstd : " 17"
@@ -126,10 +134,9 @@ jobs:
126134 env :
127135 CMAKE_PREFIX_PATH : ${{ env.LIBZMQ }}
128136 run : |
129- cmake -H. -Bbuild ${{ matrix.platform}} \
137+ cmake -H. -Bbuild ${{ matrix.platform}} ${{ matrix.coverage }} \
130138 -DCMAKE_BUILD_TYPE=${BUILDTYPE} \
131139 -DENABLE_DRAFTS=${{ matrix.drafts }} \
132- -DCOVERAGE=${COVERAGE} \
133140 -DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
134141 cmake --build build --config ${BUILDTYPE} -j ${THREADS}
135142 echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
@@ -154,3 +161,22 @@ jobs:
154161 cmake --build build --config ${BUILDTYPE}
155162 cd build
156163 ctest -V -C ${BUILDTYPE}
164+
165+ - name : lcov
166+ if : ${{ matrix.coverage && success() }}
167+ run : |
168+ sudo apt install -y lcov
169+ lcov --capture --directory . --output-file coverage.info
170+ lcov --remove coverage.info -o coverage_filtered.info \
171+ '/usr/include/*' \
172+ '/usr/local/include/*' \
173+ ${PWD}'/tests/*' \
174+ ${PWD}'/build/*'
175+ # to generate local html: genhtml coverage_filtered.info --output-directory .
176+
177+ - name : coveralls_upload
178+ if : ${{ matrix.coverage && success() }}
179+ uses : coverallsapp/github-action@master
180+ with :
181+ github-token : ${{ secrets.GITHUB_TOKEN }}
182+ path-to-lcov : ./coverage_filtered.info
0 commit comments