Skip to content

Commit

Permalink
merge w/ gcovr
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Apr 1, 2024
1 parent c87bdf7 commit 1f12ecd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ jobs:
unzip TemplateCoverage_Linux_x86_64.zip
chmod +x ./TemplateCoverage_Linux_x86_64/template-coverage
export RESOURCE_DIR=$(clang++ -print-resource-dir)
mkdir ${{github.workspace}}/coverage
python3 ./TemplateCoverage_Linux_x86_64/run_on_compile_commands.py -p ${{github.workspace}}/build/${{env.conan_preset}}/compile_commands.json ./TemplateCoverage_Linux_x86_64/template-coverage -- --format=lcov --out-file=${{github.workspace}}/coverage/template_coverage.info -extra-arg=-resource-dir=$RESOURCE_DIR
python3 ./TemplateCoverage_Linux_x86_64/run_on_compile_commands.py -p ${{github.workspace}}/build/${{env.conan_preset}}/compile_commands.json ./TemplateCoverage_Linux_x86_64/template-coverage -- --format=lcov --out-file=${{github.workspace}}/template_coverage.info -extra-arg=-resource-dir=$RESOURCE_DIR
- name: Test & code coverage
working-directory: ${{github.workspace}}/build/${{ env.conan_preset }}/bin
shell: bash
run: |
./test --reporter junit --out ${{github.workspace}}/tests.xml
llvm-profdata merge -sparse default.profraw -o coverage.profdata
llvm-cov export -format=lcov -object ./test -instr-profile=coverage.profdata > ${{github.workspace}}/coverage/test_coverage.info
llvm-cov export -format=lcov -object ./test -instr-profile=coverage.profdata > ${{github.workspace}}/test_coverage.info
pip install gcovr
gcovr -a ${{github.workspace}}/test_coverage.info -a ${{github.workspace}}/template_coverage.info --sonarqube ${{github.workspace}}/coverage.xml
- name: Run sonar-scanner
env:
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ sonar.projectName=asyncpp
sonar.sources=./src,./include
#sonar.exclusions=

sonar.cfamily.gcov.reportsPath=./coverage
sonar.coverageReportPaths=./coverage.xml
sonar.junit.reportPaths=./tests.xml
sonar.cfamily.threads=4

0 comments on commit 1f12ecd

Please sign in to comment.