Skip to content

Commit

Permalink
coverage dir
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Apr 1, 2024
1 parent 1710275 commit c87bdf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
sudo update-alternatives --remove-all gcc || true
sudo update-alternatives --remove-all g++ || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
sudo apt install lcov
- name: Cache conan packages
id: cache-conan
Expand Down Expand Up @@ -72,16 +71,16 @@ jobs:
unzip TemplateCoverage_Linux_x86_64.zip
chmod +x ./TemplateCoverage_Linux_x86_64/template-coverage
export RESOURCE_DIR=$(clang++ -print-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
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
- 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}}/test_coverage.info
lcov -a ${{github.workspace}}/template_coverage.info -a ${{github.workspace}}/test_coverage.info -o ${{github.workspace}}/coverage.info
llvm-cov export -format=lcov -object ./test -instr-profile=coverage.profdata > ${{github.workspace}}/coverage/test_coverage.info
- 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.info
sonar.cfamily.gcov.reportsPath=./coverage
sonar.junit.reportPaths=./tests.xml
sonar.cfamily.threads=4

0 comments on commit c87bdf7

Please sign in to comment.