Skip to content

Commit 7c666be

Browse files
committed
refactor github workflow: avoid conflicts during MPI coverage file copy and add gcov error ignoring for coverage generation
1 parent ab9d06a commit 7c666be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/ubuntu.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,10 @@ jobs:
375375
cd build
376376
# Collect coverage data from all MPI rank directories and regular build directory
377377
# Copy coverage files from MPI rank directories to main build directory
378+
# Only copy files that don't already exist to avoid conflicts
378379
if [ -d "gcov_data" ]; then
379-
find gcov_data -name "*.gcda" -exec cp {} . \;
380-
find gcov_data -name "*.gcno" -exec cp {} . \;
380+
find gcov_data -name "*.gcda" -exec bash -c 'cp "$1" "$(basename "$1")" 2>/dev/null || true' _ {} \;
381+
find gcov_data -name "*.gcno" -exec bash -c 'cp "$1" "$(basename "$1")" 2>/dev/null || true' _ {} \;
381382
fi
382383
383384
gcovr -r ../ \
@@ -392,6 +393,7 @@ jobs:
392393
--exclude '.*modules/util/include/func_test_util.hpp' \
393394
--exclude '.*modules/util/src/func_test_util.cpp' \
394395
--gcov-ignore-parse-errors \
396+
--gcov-ignore-errors \
395397
--xml --output ../coverage.xml \
396398
--html=../cov-report/index.html \
397399
--html-details=../cov-report/ \

0 commit comments

Comments
 (0)