Skip to content

Commit ab9d06a

Browse files
committed
refactor github workflow: simplify MPI coverage file handling by consolidating file searches and removing redundant path logic
1 parent bdb4ef2 commit ab9d06a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/ubuntu.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,14 @@ jobs:
374374
mkdir cov-report
375375
cd build
376376
# Collect coverage data from all MPI rank directories and regular build directory
377-
# Find existing gcov_data directories
378-
SEARCH_PATHS="."
379-
for rank_dir in gcov_data/rank_*; do
380-
if [ -d "$rank_dir" ]; then
381-
SEARCH_PATHS="$SEARCH_PATHS $rank_dir"
382-
fi
383-
done
377+
# Copy coverage files from MPI rank directories to main build directory
378+
if [ -d "gcov_data" ]; then
379+
find gcov_data -name "*.gcda" -exec cp {} . \;
380+
find gcov_data -name "*.gcno" -exec cp {} . \;
381+
fi
384382
385383
gcovr -r ../ \
384+
--gcov-object-directory . \
386385
--exclude '.*3rdparty/.*' \
387386
--exclude '/usr/.*' \
388387
--exclude '.*tasks/.*/tests/.*' \
@@ -396,7 +395,7 @@ jobs:
396395
--xml --output ../coverage.xml \
397396
--html=../cov-report/index.html \
398397
--html-details=../cov-report/ \
399-
$SEARCH_PATHS
398+
.
400399
- name: Upload coverage reports to Codecov
401400
uses: codecov/[email protected]
402401
with:

0 commit comments

Comments
 (0)