Skip to content

Commit c79a67a

Browse files
authored
Fix coverage CI (#149)
* Add -fprofile-update=atomic * Update actions/cache version to v4 in workflow files * Ignore lcov errors * Improve lcov command to ignore gcov errors and unused data in coverage reports
1 parent 203d5c6 commit c79a67a

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

.github/workflows/continuous.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Cache Build
6868
id: cache-build
69-
uses: actions/cache@v4.0.2
69+
uses: actions/cache@v4
7070
with:
7171
path: ${{ env.CACHE_PATH }}
7272
key: ${{ runner.os }}-${{ matrix.config }}-cache

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Cache Build
3737
id: cache-build
38-
uses: actions/cache@v4.0.2
38+
uses: actions/cache@v4
3939
with:
4040
path: ${{ env.CACHE_PATH }}
4141
key: coverage-cache
@@ -64,8 +64,8 @@ jobs:
6464
run: |
6565
cd build
6666
ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
67-
lcov --directory . --capture --output-file coverage.info
68-
lcov --remove coverage.info '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info
67+
lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format,gcov
68+
lcov --remove coverage.info --ignore-errors unused '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info
6969
7070
- name: Upload coverage reports to Codecov
7171
uses: codecov/[email protected]

.github/workflows/cuda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
sudo apt-get install ccache
3838
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV"
39-
39+
4040
- name: cuda-toolkit
4141
uses: Jimver/[email protected]
4242
with:
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Cache Build
5151
id: cache-build
52-
uses: actions/cache@v4.0.2
52+
uses: actions/cache@v4
5353
with:
5454
path: ${{ env.CACHE_PATH }}
5555
key: ${{ runner.os }}-${{ matrix.config }}-cache

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Cache Build
3333
id: cache-build
34-
uses: actions/cache@v4.0.2
34+
uses: actions/cache@v4
3535
with:
3636
path: ${{ env.CACHE_PATH }}
3737
key: docs-cache

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
6363
- name: Cache Build
6464
id: cache-build
65-
uses: actions/cache@v4.0.2
65+
uses: actions/cache@v4
6666
with:
6767
path: ${{ env.CACHE_PATH }}
6868
key: ${{ runner.os }}-Python${{ matrix.python-version }}-cache

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,15 @@ endif()
255255

256256
if(IPC_TOOLKIT_WITH_CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
257257
# Add required flags (GCC & LLVM/Clang)
258-
target_compile_options(ipc_toolkit PUBLIC
258+
target_compile_options(ipc_toolkit PRIVATE
259259
-g # generate debug info
260260
--coverage # sets all required flags
261+
-fprofile-update=atomic
262+
)
263+
target_link_options(ipc_toolkit PUBLIC
264+
--coverage
265+
-fprofile-update=atomic
261266
)
262-
target_link_options(ipc_toolkit PUBLIC --coverage)
263267
endif()
264268

265269
################################################################################

0 commit comments

Comments
 (0)