mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-20 18:06:00 +00:00
Update sonar github action
This commit is contained in:
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.6
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
- name: Install sonar-scanner and build-wrapper
|
- name: Install sonar-scanner and build-wrapper
|
||||||
@@ -28,17 +28,20 @@ jobs:
|
|||||||
unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cpu.zip
|
unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cpu.zip
|
||||||
- name: Tests & build-wrapper
|
- name: Tests & build-wrapper
|
||||||
run: |
|
run: |
|
||||||
cmake -S . -B build -Wno-dev -DCMAKE_PREFIX_PATH=$(pwd)/libtorch -DENABLE_TESTING=ON
|
cmake -S . -B build -Wno-dev -DCMAKE_PREFIX_PATH=$(pwd)/libtorch -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON
|
||||||
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
|
||||||
cd build
|
cmake --build build -j 4
|
||||||
make
|
ctest -C Debug --output-on-failure -j 4
|
||||||
ctest -C Release --output-on-failure --test-dir tests
|
lcov --capture --directory ../ --demangle-cpp --ignore-errors source,source --ignore-errors mismatch --output-file coverage.info
|
||||||
cd ..
|
lcov --remove coverage.info '/usr/*' --output-file coverage.info
|
||||||
gcovr -f CPPFImdlp.cpp -f Metrics.cpp -f BinDisc.cpp -f Discretizer.cpp --txt --sonarqube=coverage.xml
|
lcov --remove coverage.info 'lib/*' --output-file coverage.info
|
||||||
|
lcov --remove coverage.info 'libtorch/*' --output-file coverage.info
|
||||||
|
lcov --remove coverage.info 'tests/*' --output-file coverage.info
|
||||||
|
lcov --remove coverage.info 'gtest/*' --output-file coverage.info
|
||||||
- name: Run sonar-scanner
|
- name: Run sonar-scanner
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
|
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
|
||||||
--define sonar.coverageReportPaths=coverage.xml
|
--define sonar.coverageReportPaths=build/coverage.info
|
||||||
|
@@ -3,7 +3,7 @@ sonar.organization=rmontanana
|
|||||||
|
|
||||||
# This is the name and version displayed in the SonarCloud UI.
|
# This is the name and version displayed in the SonarCloud UI.
|
||||||
sonar.projectName=mdlp
|
sonar.projectName=mdlp
|
||||||
sonar.projectVersion=1.2.1
|
sonar.projectVersion=2.0.0
|
||||||
# sonar.test.exclusions=tests/**
|
# sonar.test.exclusions=tests/**
|
||||||
# sonar.tests=tests/
|
# sonar.tests=tests/
|
||||||
# sonar.coverage.exclusions=tests/**,sample/**
|
# sonar.coverage.exclusions=tests/**,sample/**
|
||||||
@@ -12,3 +12,4 @@ sonar.projectVersion=1.2.1
|
|||||||
|
|
||||||
# Encoding of the source code. Default is default system encoding
|
# Encoding of the source code. Default is default system encoding
|
||||||
sonar.sourceEncoding=UTF-8
|
sonar.sourceEncoding=UTF-8
|
||||||
|
sonar.cfamily.compile-commands
|
Reference in New Issue
Block a user