Skip to content

Commit

Permalink
Try to generate coverage for Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Nov 2, 2023
1 parent 6555593 commit 14de3f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/sonar.yml
Expand Up @@ -27,6 +27,17 @@ jobs:
CXX: g++-13
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -j5 debug debug_test
- name: Run the tests
run: make run_release_debug_test
- name: Generate coverage reports
run: |
mkdir gcov-reports
pushd gcov-reports
for f in $(find ../debug -iname '*.o'); do
gcov --preserve-paths -o $f x
done
popd
run: make run_release_debug_test
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ release_debug
debug
*.plist
.cache
gcov-reports
3 changes: 3 additions & 0 deletions sonar-project.properties
Expand Up @@ -8,6 +8,9 @@ sonar.projectVersion=1.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=.

Expand Down

0 comments on commit 14de3f3

Please sign in to comment.