Skip to content

Commit d7b7f06

Browse files
committed
feat: testing sonarqube in the pipeline
1 parent d1ab167 commit d7b7f06

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
conan profile detect --force
5959
conan install . --build=missing -s build_type=Debug
6060
61-
- name: Build
61+
- name: Build and Test
6262
run: |
6363
set -e
6464
cmake --preset=debug
@@ -70,9 +70,23 @@ jobs:
7070
--output-file lcov.info \
7171
--rc geninfo_unexecuted_blocks=1 \
7272
--ignore-errors mismatch
73-
lcov --remove lcov.info '/home/*' '/usr/*' 'tests/*' --output-file lcov_filtered.info
73+
# lcov --remove lcov.info '/home/*' '/usr/*' 'tests/*' --output-file lcov_filtered.info
74+
# TODO: need to solve mismatch before proceeding, custom docker image
7475

76+
# TODO: should coverage be published in the case that SonarQube fails?
7577
- name: Upload coverage to Coveralls
7678
uses: coverallsapp/github-action@v2
7779
with:
7880
path-to-lcov: lcov_filtered.info
81+
82+
sonarqube:
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v4
86+
with:
87+
# Disabling shallow clones is recommended for improving the relevancy of reporting
88+
fetch-depth: 0
89+
- name: SonarQube Scan
90+
uses: SonarSource/sonarqube-scan-action@v6.0.0
91+
env:
92+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sonar.host.url=https://sonarcloud.io
2+
sonar.organization=milsanore
3+
sonar.projectKey=milsanore_trader.cpp
4+
5+
# Sources
6+
sonar.sources=src
7+
sonar.cfamily.compile-commands=build/Debug/compile_commands.json
8+
9+
# Optional: coverage (see below)
10+
sonar.cpp.coverage.reportPath=lcov.info

0 commit comments

Comments
 (0)