Skip to content

Commit c1329ae

Browse files
facontidavideclaude
andcommitted
Add Coveralls, Codacy, and SonarCloud coverage uploads
Trial of three Codecov alternatives, all with continue-on-error so the workflow stays green while accounts/tokens are configured. - Coveralls: lcov upload via coverallsapp/github-action@v2 - Codacy: needs CODACY_PROJECT_TOKEN secret - SonarCloud: needs SONAR_TOKEN secret, uses compile_commands.json Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5f75e35 commit c1329ae

2 files changed

Lines changed: 41 additions & 7 deletions

File tree

.github/workflows/cmake_ubuntu.yml

Lines changed: 32 additions & 0 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
@@ -99,6 +101,7 @@ jobs:
99101
100102
- name: Upload coverage reports to Codecov
101103
uses: codecov/codecov-action@v5
104+
continue-on-error: true
102105
with:
103106
files: coverage.info
104107
flags: unittests
@@ -108,3 +111,32 @@ jobs:
108111
network_filter: >-
109112
include/behaviortree_cpp/,src/
110113
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: Install SonarCloud tools
134+
uses: SonarSource/sonarcloud-github-c-cpp@v3
135+
continue-on-error: true
136+
137+
- name: Run SonarCloud analysis
138+
continue-on-error: true
139+
env:
140+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142+
run: sonar-scanner

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)