Skip to content

Commit

Permalink
Generate coverage reports for Sonar
Browse files Browse the repository at this point in the history
wichtounet committed Nov 2, 2023

Verified

This commit was signed with the committer’s verified signature.
wichtounet Baptiste Wicht
1 parent c4595e9 commit d822aab
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -27,6 +27,16 @@ jobs:
CXX: g++-13
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -j5 debug
- name: Run the tests
run: make -j1 debug_test
- name: Generate coverage reports
run: |
mkdir gcov-reports
pushd gcov-reports
for f in $(find ../debug -iname '*.o'); do
gcov-13 --preserve-paths -o $f x
done
popd
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ sonar.projectVersion=1.3.0
# C++23 support in SonarCloud is experimental, so enable it
sonar.cfamily.cpp23.enabled=true

# Get coverage from gcov files
sonar.cfamily.gcov.reportsPath=gcov-reports

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

0 comments on commit d822aab

Please sign in to comment.