Skip to content

Commit 328e530

Browse files
committed
refactor github workflow: dynamically detect gcov_data directories to simplify coverage report generation
1 parent 6c4ba81 commit 328e530

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/ubuntu.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +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
384+
377385
gcovr -r ../ \
378386
--exclude '.*3rdparty/.*' \
379387
--exclude '/usr/.*' \
@@ -388,7 +396,7 @@ jobs:
388396
--xml --output ../coverage.xml \
389397
--html=../cov-report/index.html \
390398
--html-details=../cov-report/ \
391-
. gcov_data/rank_0 gcov_data/rank_1 gcov_data/rank_2 gcov_data/rank_3
399+
$SEARCH_PATHS
392400
- name: Upload coverage reports to Codecov
393401
uses: codecov/[email protected]
394402
with:

0 commit comments

Comments
 (0)