Commit deef871f authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'sonarqube' into 'master'

Sonarqube

See merge request !63
parents e3daf9a8 3a6cf145
......@@ -34,10 +34,34 @@ quark:
- ctest -V -R test_shm_s
doc:
artifacts:
name: chameleon_doc
expire_in: 1 week
paths:
- build/doc/doxygen
- build/doc/orgmode
script:
- source .gitlab-ci-env.sh
- git submodule update --init --recursive
- mkdir -p build
- cd build
- cmake .. -DCHAMELEON_ENABLE_DOC=ON -DCHAMELEON_ENABLE_EXAMPLES=OFF -DCHAMELEON_ENABLE_TESTING=OFF -DCHAMELEON_ENABLE_TIMING=OFF
- make
- cmake .. -DCHAMELEON_ENABLE_DOC=ON -DCHAMELEON_ENABLE_EXAMPLE=OFF -DCHAMELEON_ENABLE_TESTING=OFF -DCHAMELEON_ENABLE_TIMING=OFF
- make doc
analysis:
artifacts:
name: chameleon_analysis
expire_in: 1 week
paths:
- chameleon-build.log
- coverage/
- chameleon-coverage.xml
- chameleon-cppcheck.xml
- chameleon-rats.xml
- sonar.log
script:
- source .gitlab-ci-env.sh
- git submodule update --init --recursive
- ./tools/analysis.sh
only:
- master
Subproject commit b356d3a5b5a417e49a60aa3b6127221717fe0f1d
Subproject commit 6acb22e9e8d3ebe89bfe25e1102f77a339fbed06
#!/bin/bash
# Performs an analysis of Chameleon source code
# We consider to be in Chameleon's source code root
# build with proper options
mkdir -p build
cd build
rm * -rf
cmake .. -DCHAMELEON_USE_MPI=ON -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_VERBOSE_MAKEFILE=ON -DMORSE_ENABLE_WARNING=ON -DMORSE_ENABLE_COVERAGE=ON
make -j5 | tee ../chameleon-build.log
# run tests
STARPU_SILENT=1 ctest --no-compress-output || /usr/bin/true
# capture coverage
lcov --directory . --capture --output-file ../chameleon.lcov
cd ..
genhtml -o coverage chameleon.lcov
lcov_cobertura.py chameleon.lcov --output chameleon-coverage.xml
# filter sources:
# - consider generated files in build
# - exclude base *z* files to avoid duplication
# - exclude cblas.h and lapacke-.h because not really part of chameleon and make cppcheck analysis too long
./tools/find_sources.sh
# Undefine this because not relevant in our configuration
export UNDEFINITIONS="-UCHAMELEON_USE_OPENCL -UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus"
# run cppcheck analysis
cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${UNDEFINITIONS} --file-list=./filelist.txt 2> chameleon-cppcheck.xml
# run rats analysis
rats -w 3 --xml `cat filelist.txt` > chameleon-rats.xml
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://hpclib-sed.bordeaux.inria.fr/sonarqube-dev
sonar.links.homepage=https://gitlab.inria.fr/solverstack/chameleon
sonar.links.ci=https://gitlab.inria.fr/solverstack/chameleon/pipelines
sonar.links.scm=https://gitlab.inria.fr/solverstack/chameleon/
sonar.projectKey=chameleon
sonar.projectName=Chameleon
sonar.projectDescription=Dense linear algebra subroutines for heterogeneous and distributed architectures
sonar.projectVersion=master
sonar.language=c++
sonar.sources=build, compute, control, coreblas, example, include, runtime, testing, timing
sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'`
sonar.sourceEncoding=UTF-8
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.parser=GCC
sonar.cxx.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
sonar.cxx.compiler.reportPath=chameleon-build.log
sonar.cxx.coverage.reportPath=chameleon-coverage.xml
sonar.cxx.cppcheck.reportPath=chameleon-cppcheck.xml
sonar.cxx.rats.reportPath=chameleon-rats.xml
EOF
# run sonar analysis + publish on sonarqube-dev
sonar-scanner -X -Dsonar.login=077ef775a8b4fe9ba722497ef0511ca6dcfb3fcd > sonar.log
#!/bin/sh
set -x
SRCDIR_TO_ANALYZE="build compute control coreblas example include runtime testing timing"
echo $PWD
rm -f filelist.txt
for dir in ${SRCDIR_TO_ANALYZE}
do
find $dir -name '*\.[ch]' >> filelist.txt
done
# Remove all CMakeFiles generated file
sed -i '/CMakeFiles/d' filelist.txt
# Remove installed files
sed -i '/build\/install.*/d' filelist.txt
# Remove original files used for precision generation
for file in `git grep "@precisions" | awk -F ":" '{ print $1 }'`
do
sed -i "\:^$file.*:d" filelist.txt
done
# Remove external header files
for file in coreblas/include/coreblas/cblas.h coreblas/include/coreblas/lapacke.h coreblas/include/coreblas/lapacke_config.h coreblas/include/coreblas/lapacke_mangling.h
do
sed -i "\:^$file.*:d" filelist.txt
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment