Skip to content

Commit 5c0acc4

Browse files
committed
add coverage
Signed-off-by: Mykhailo Lohvynenko <Mykhailo_Lohvynenko@epam.com>
1 parent b3358b1 commit 5c0acc4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build_test.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24-
# - name: Prepare
25-
# run: |
26-
# sudo apt install lcov libsofthsm2 -y
24+
- name: Prepare
25+
run: |
26+
sudo apt install lcov gcovr libsofthsm2 -y
2727
2828
- name: Install Build Wrapper
2929
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4
3030

3131
- name: Run Build Wrapper
3232
run: |
3333
mkdir build
34-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DWITH_TEST=ON -DWITH_COVERAGE=ON -G "Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
35-
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
34+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DWITH_TEST=ON -DWITH_COVERAGE=ON -G "Unix Makefiles" -DCoverage_SONARQUBE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
35+
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
36+
(cd build && make coverage)
3637
3738
# ls -la build_wrapper_output_directory
3839
# ls -la build
@@ -53,6 +54,7 @@ jobs:
5354
with:
5455
args: >
5556
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
57+
--define sonar.coverageReportPaths=build/coverage.xml
5658
5759
# make; make tests; make coverage
5860

0 commit comments

Comments
 (0)