Skip to content

Commit deae944

Browse files
facontidavideclaude
andcommitted
Fix coverage CI: add Coveralls, Codacy, SonarCloud alongside Codecov
- Fix lcov warnings with doubled --ignore-errors syntax and gcov filter - Re-enable Codecov file_fixes (needed for path resolution) - Use network_filter to restrict Codecov file discovery - Add Coveralls (coverallsapp/github-action@v2) - works with GITHUB_TOKEN - Add Codacy (codacy/codacy-coverage-reporter-action@v1) - needs CODACY_PROJECT_TOKEN - Add SonarCloud (sonarcloud-github-action@v5) - needs SONAR_TOKEN - Update sonar-project.properties with coverage/analysis settings - All coverage uploads use continue-on-error for resilience Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4551d2a commit deae944

2 files changed

Lines changed: 44 additions & 9 deletions

File tree

.github/workflows/cmake_ubuntu.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151

5252
steps:
5353
- uses: actions/checkout@v6
54+
with:
55+
fetch-depth: 0 # Full history needed by SonarCloud
5456

5557
- name: Install lcov
5658
run: sudo apt-get update && sudo apt-get install -y lcov
@@ -83,8 +85,9 @@ jobs:
8385
run: |
8486
lcov --capture --directory build/Debug \
8587
--output-file coverage.info \
86-
--ignore-errors mismatch \
87-
--ignore-errors negative
88+
--ignore-errors mismatch,mismatch \
89+
--ignore-errors negative,negative \
90+
--ignore-errors gcov,gcov
8891
lcov --extract coverage.info \
8992
'*/BehaviorTree.CPP/include/*' \
9093
'*/BehaviorTree.CPP/src/*' \
@@ -98,8 +101,38 @@ jobs:
98101
99102
- name: Upload coverage reports to Codecov
100103
uses: codecov/codecov-action@v5
104+
continue-on-error: true
101105
with:
102106
files: coverage.info
103107
flags: unittests
104108
disable_search: true
109+
disable_file_fixes: false
110+
plugins: noop
111+
network_filter: >-
112+
include/behaviortree_cpp/,src/
105113
token: ${{ secrets.CODECOV_TOKEN }}
114+
115+
# --- Coveralls ---
116+
- name: Upload to Coveralls
117+
uses: coverallsapp/github-action@v2
118+
continue-on-error: true
119+
with:
120+
file: coverage.info
121+
format: lcov
122+
github-token: ${{ secrets.GITHUB_TOKEN }}
123+
124+
# --- Codacy ---
125+
- name: Upload to Codacy
126+
uses: codacy/codacy-coverage-reporter-action@v1
127+
continue-on-error: true
128+
with:
129+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
130+
coverage-reports: coverage.info
131+
132+
# --- SonarCloud ---
133+
- name: Run SonarCloud analysis
134+
uses: SonarSource/sonarcloud-github-action@v5
135+
continue-on-error: true
136+
env:
137+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

sonar-project.properties

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
sonar.projectKey=BehaviorTree_BehaviorTree.CPP
22
sonar.organization=behaviortree
3+
sonar.host.url=https://sonarcloud.io
34

4-
# This is the name and version displayed in the SonarCloud UI.
5-
#sonar.projectName=BehaviorTree.CPP
6-
#sonar.projectVersion=1.0
5+
sonar.sources=src,include/behaviortree_cpp
6+
sonar.tests=tests
7+
sonar.sourceEncoding=UTF-8
78

9+
# C++ analysis via compile_commands.json (no build-wrapper needed)
10+
sonar.cfamily.compile-commands=build/Debug/compile_commands.json
811

9-
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10-
#sonar.sources=.
12+
# Coverage: point to directory containing .gcda/.gcno files
13+
sonar.cfamily.gcov.reportsPath=build/Debug
1114

12-
# Encoding of the source code. Default is default system encoding
13-
#sonar.sourceEncoding=UTF-8
15+
# Exclude vendored code
1416
sonar.exclusions=3rdparty/**/*

0 commit comments

Comments
 (0)