#6750 Got coverage working, removed clang tidy as that is automatic
This commit is contained in:
parent
841f422773
commit
c5b417d7c8
3 changed files with 8 additions and 22 deletions
15
.github/workflows/job-sonarcloud.yml
vendored
15
.github/workflows/job-sonarcloud.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- name: Run Sonar
|
- name: Run Sonar
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y gcovr clang-tidy
|
apt-get install -y gcovr
|
||||||
export SONAR_SCANNER_VERSION=4.4.0.2170
|
export SONAR_SCANNER_VERSION=4.4.0.2170
|
||||||
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
||||||
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
|
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
|
||||||
|
|
@ -36,13 +36,10 @@ jobs:
|
||||||
cd build-release
|
cd build-release
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_COVERAGE=ON ..
|
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_COVERAGE=ON ..
|
||||||
. ./version
|
. ./version
|
||||||
echo "Building, output redirected to file due to verbrosity this may take 10-15 mins to complete..."
|
|
||||||
build-wrapper-linux-x86-64 --out-dir bw-output make -j > output.txt 2>&1
|
|
||||||
|
|
||||||
echo "Outputting last 200 lines of the build..."
|
build-wrapper-linux-x86-64 --out-dir bw-output make -j
|
||||||
tail -200 output.txt
|
|
||||||
|
|
||||||
make unit_coverage
|
make coverage
|
||||||
|
|
||||||
sonar-scanner \
|
sonar-scanner \
|
||||||
-Dsonar.organization=symless \
|
-Dsonar.organization=symless \
|
||||||
|
|
@ -51,8 +48,8 @@ jobs:
|
||||||
-Dsonar.projectBaseDir=../ \
|
-Dsonar.projectBaseDir=../ \
|
||||||
-Dsonar.exclusions=./ext/**,**/build-release/** \
|
-Dsonar.exclusions=./ext/**,**/build-release/** \
|
||||||
-Dsonar.cfamily.build-wrapper-output=bw-output \
|
-Dsonar.cfamily.build-wrapper-output=bw-output \
|
||||||
-Dsonar.host.url=https://sonarcloud.io
|
-Dsonar.host.url=https://sonarcloud.io \
|
||||||
-Dsonar.cxx.coverage.reportPath=unit_coverage.xml
|
-Dsonar.coverageReportPaths=build-release/coverage.xml
|
||||||
-Dsonar.cxx.clangtidy.reportPath=output.txt
|
|
||||||
env:
|
env:
|
||||||
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
|
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
|
||||||
|
|
|
||||||
|
|
@ -40,21 +40,10 @@ if (ENABLE_COVERAGE)
|
||||||
include(cmake/CodeCoverage.cmake)
|
include(cmake/CodeCoverage.cmake)
|
||||||
append_coverage_compiler_flags()
|
append_coverage_compiler_flags()
|
||||||
setup_target_for_coverage_gcovr_xml(
|
setup_target_for_coverage_gcovr_xml(
|
||||||
NAME unit_coverage
|
NAME coverage
|
||||||
EXECUTABLE unittests
|
EXECUTABLE unittests
|
||||||
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
|
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
|
||||||
EXCLUDE "ext/*")
|
EXCLUDE "ext/*")
|
||||||
setup_target_for_coverage_gcovr_xml(
|
|
||||||
NAME integ_coverage
|
|
||||||
EXECUTABLE integtests
|
|
||||||
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
|
|
||||||
EXCLUDE "ext/*")
|
|
||||||
|
|
||||||
#Add ClangTidy Reports
|
|
||||||
set(CMAKE_CXX_CLANG_TIDY
|
|
||||||
clang-tidy;
|
|
||||||
-header-filter=.;
|
|
||||||
-checks=*;)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ function(setup_target_for_coverage_gcovr_xml)
|
||||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||||
|
|
||||||
# Running gcovr
|
# Running gcovr
|
||||||
COMMAND ${GCOVR_PATH} --xml
|
COMMAND ${GCOVR_PATH} --sonarqube
|
||||||
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
||||||
--object-directory=${PROJECT_BINARY_DIR}
|
--object-directory=${PROJECT_BINARY_DIR}
|
||||||
-o ${Coverage_NAME}.xml
|
-o ${Coverage_NAME}.xml
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue