7575 LIBMESH : ${{ matrix.libmesh }}
7676 NPY_DISABLE_CPU_FEATURES : " AVX512F AVX512_SKX"
7777 OPENBLAS_NUM_THREADS : 1
78+ PYTEST_ADDOPTS : --cov=openmc --cov-report=lcov:coverage-python.lcov
7879 # libfabric complains about fork() as a result of using Python multiprocessing.
7980 # We can work around it with RDMAV_FORK_SAFE=1 in libfabric < 1.13 and with
8081 # FI_EFA_FORK_SAFE=1 in more recent versions.
@@ -171,11 +172,37 @@ jobs:
171172 uses : mxschmitt/action-tmate@v3
172173 timeout-minutes : 10
173174
174- - name : after_success
175+ - name : Generate C++ coverage (gcovr)
175176 shell : bash
176177 run : |
177- cpp-coveralls -i src -i include -e src/external --exclude-pattern "/usr/*" --dump cpp_cov.json
178- coveralls --merge=cpp_cov.json --service=github
178+ # Produce LCOV directly from gcov data in the build tree
179+ gcovr \
180+ --root "$GITHUB_WORKSPACE" \
181+ --object-directory "$GITHUB_WORKSPACE/build" \
182+ --filter "$GITHUB_WORKSPACE/src" \
183+ --filter "$GITHUB_WORKSPACE/include" \
184+ --exclude "$GITHUB_WORKSPACE/src/external/.*" \
185+ --exclude "$GITHUB_WORKSPACE/src/include/openmc/external/.*" \
186+ --gcov-ignore-errors source_not_found \
187+ --gcov-ignore-errors output_error \
188+ --gcov-ignore-parse-errors suspicious_hits.warn \
189+ --print-summary \
190+ --lcov -o coverage-cpp.lcov || true
191+
192+ - name : Merge C++ and Python coverage
193+ shell : bash
194+ run : |
195+ # Merge C++ and Python LCOV into a single file for upload
196+ cat coverage-cpp.lcov coverage-python.lcov > coverage.lcov
197+
198+ - name : Upload coverage to Coveralls
199+ if : ${{ hashFiles('coverage.lcov') != '' }}
200+ uses : coverallsapp/github-action@v2
201+ with :
202+ github-token : ${{ secrets.GITHUB_TOKEN }}
203+ parallel : true
204+ flag-name : C++ and Python
205+ path-to-lcov : coverage.lcov
179206
180207 finish :
181208 needs : main
@@ -184,5 +211,5 @@ jobs:
184211 - name : Coveralls Finished
185212 uses : coverallsapp/github-action@v2
186213 with :
187- github-token : ${{ secrets.github_token }}
214+ github-token : ${{ secrets.GITHUB_TOKEN }}
188215 parallel-finished : true
0 commit comments