#6750 Got coverage working, removed clang tidy as that is automatic

This commit is contained in:
Jamie Newbon 2020-08-25 15:18:35 +01:00
parent 841f422773
commit c5b417d7c8
3 changed files with 8 additions and 22 deletions

View file

@ -20,7 +20,7 @@ jobs:
- name: Run Sonar
run: |
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_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
@ -36,13 +36,10 @@ jobs:
cd build-release
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_COVERAGE=ON ..
. ./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..."
tail -200 output.txt
build-wrapper-linux-x86-64 --out-dir bw-output make -j
make unit_coverage
make coverage
sonar-scanner \
-Dsonar.organization=symless \
@ -51,8 +48,8 @@ jobs:
-Dsonar.projectBaseDir=../ \
-Dsonar.exclusions=./ext/**,**/build-release/** \
-Dsonar.cfamily.build-wrapper-output=bw-output \
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.cxx.coverage.reportPath=unit_coverage.xml
-Dsonar.cxx.clangtidy.reportPath=output.txt
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.coverageReportPaths=build-release/coverage.xml
env:
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}

View file

@ -40,21 +40,10 @@ if (ENABLE_COVERAGE)
include(cmake/CodeCoverage.cmake)
append_coverage_compiler_flags()
setup_target_for_coverage_gcovr_xml(
NAME unit_coverage
NAME coverage
EXECUTABLE unittests
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
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()

View file

@ -334,7 +334,7 @@ function(setup_target_for_coverage_gcovr_xml)
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
# Running gcovr
COMMAND ${GCOVR_PATH} --xml
COMMAND ${GCOVR_PATH} --sonarqube
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
--object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}.xml