Skip to content

Commit c58e46b

Browse files
facontidavideclaude
andcommitted
Replace symlink approach with rm -rf to prune Codecov file discovery
The symlinked root_dir broke path resolution — Codecov maps coverage paths against the git repo, not the network root. Instead, simply delete unwanted directories before upload so Codecov never sees them. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent aafa7b8 commit c58e46b

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

.github/workflows/cmake_ubuntu.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,20 @@ jobs:
9696
--ignore-errors unused
9797
lcov --list coverage.info
9898
99-
- name: Prepare coverage source tree
99+
- name: Prune directories from Codecov file discovery
100100
run: |
101-
# Build a clean source tree with only the directories we want
102-
# Codecov to see, excluding contrib/ and flatbuffers/
103-
mkdir -p codecov_root/include/behaviortree_cpp
104-
ln -s "$PWD/src" codecov_root/src
105-
for item in include/behaviortree_cpp/*; do
106-
name=$(basename "$item")
107-
case "$name" in
108-
contrib|flatbuffers) continue ;;
109-
esac
110-
ln -s "$PWD/$item" "codecov_root/include/behaviortree_cpp/$name"
111-
done
112-
# Rewrite absolute paths in coverage.info to be relative to codecov_root
113-
sed -i "s|$PWD/||g" coverage.info
101+
# Remove directories we don't want Codecov to discover as source files.
102+
# Coverage data for these was already stripped by lcov above.
103+
rm -rf examples sample_nodes tests tools \
104+
include/behaviortree_cpp/contrib \
105+
include/behaviortree_cpp/flatbuffers \
106+
3rdparty
114107
115108
- name: Upload coverage reports to Codecov
116109
uses: codecov/codecov-action@v5
117110
with:
118111
files: coverage.info
119112
flags: unittests
120113
disable_search: true
121-
root_dir: codecov_root
122114
plugins: noop
123115
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)