Commit a4bfb9ef authored by Mathieu Faverge's avatar Mathieu Faverge

Merge branch 'feature/ci' into 'master'

Add gitlab analysis

See merge request !11
parents b0e35db3 71a8168c
Pipeline #53586 passed with stages
in 4 minutes and 47 seconds
#!/bin/sh
if [ $# -gt 0 ]
then
BUILDDIR=$1
fi
BUILDDIR=${BUILDDIR-=build}
echo $PWD
rm -f filelist.txt
git ls-files | grep "\.[ch]pp" > filelist.txt
# Remove all CMakeFiles generated file
sed -i '/CMakeFiles/d' filelist.txt
# Remove all external file
sed -i '/^external/d' filelist.txt
# Remove all .cmake files
sed -i '/.cmake/d' filelist.txt
# Remove all .in files
sed -i '/.in$/d' filelist.txt
# Remove all clang files
sed -i '/^\.clang/d' filelist.txt
# Remove installed files
sed -i '/^install.*/d' filelist.txt
grep '\.cpp$' filelist.txt > filelist-c.txt
image: hpclib/hiepacs
stages:
- build
- sonar
build_vite:
stage: build
artifacts:
name: vite_build
expire_in: 42 minutes
untracked: true
script:
- git submodule update --init --recursive
- mkdir build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../install -DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_FLAGS="-O0 -g -fPIC --coverage -Wall -fdiagnostics-show-option -fno-inline" -DCMAKE_EXE_LINKER_FLAGS="--coverage" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- make -j 4 | tee ../vite-build.log
- make install | tee -a ../vite-build.log
only:
- branches
- master@solverstack/vite
sonar_vite:
stage: sonar
dependencies:
- build_vite
artifacts:
name: vite_sonar
expire_in: 1 week
paths:
- vite-cppcheck.xml
- vite-rats.xml
- sonar.log
script:
- ./analysis.sh
only:
- master@solverstack/vite
......@@ -104,6 +104,7 @@ if (USE_QT5)
else(USE_QT5) # Try Qt4
set(CMAKE_AUTOMOC ON)
find_package(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
set(QT_USE_QTUITOOLS ON)
set(QT_USE_QTOPENGL ON)
......@@ -111,6 +112,7 @@ else(USE_QT5) # Try Qt4
endif(USE_QT5)
set( OpenGL_GL_PREFERENCE LEGACY )
find_package(OpenGL)
#find_package(GLU)
......
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "ViTE")
set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "cdash.inria.fr")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=vite")
set(CTEST_DROP_SITE_CDASH TRUE)
#--------------------------------------------------------------------
# BUILDNAME variable construction
# This variable will be used to set the build name which will appear
# on the ViTE dashboard http://cdash.inria.fr/CDash/
#--------------------------------------------------------------------
# Start with the short system name, e.g. "Linux", "FreeBSD" or "Windows"
if(NOT BUILDNAME)
set(BUILDNAME "${CMAKE_SYSTEM_NAME}")
# Add i386 or amd64
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BUILDNAME "${BUILDNAME}-amd64")
else()
set(BUILDNAME "${BUILDNAME}-i386")
endif()
# Add compiler name
get_filename_component(CMAKE_C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
set(BUILDNAME "${BUILDNAME}-${CMAKE_C_COMPILER_NAME}")
# Add the build type, e.g. "Debug, Release..."
if(CMAKE_BUILD_TYPE)
set(BUILDNAME "${BUILDNAME}-${CMAKE_BUILD_TYPE}")
endif(CMAKE_BUILD_TYPE)
# Specific options of Pastix
if(USE_QT5)
set(BUILDNAME "${BUILDNAME}-Qt5")
else()
set(BUILDNAME "${BUILDNAME}-Qt4")
endif()
if(VITE_ENABLE_TAU)
set(BUILDNAME "${BUILDNAME}-Tau")
endif(VITE_ENABLE_TAU)
if(VITE_ENABLE_OTF)
set(BUILDNAME "${BUILDNAME}-OTF")
endif(VITE_ENABLE_OTF)
if(VITE_ENABLE_OTF2)
set(BUILDNAME "${BUILDNAME}-OTF2")
endif(VITE_ENABLE_OTF2)
endif()
#!/bin/bash
# Performs an analysis of Vite source code:
# - we consider to be in Vite's source code root
# - we consider having the coverage file vite.lcov in the root directory
# - we consider having cppcheck, rats, sonar-scanner programs available in the environment
# filter sources:
# - consider generated files in ${BUILDDIR}
# - exclude base *z* files to avoid duplication
# - exclude cblas.h and lapacke-.h because not really part of vite and make cppcheck analysis too long
if [ $# -gt 0 ]
then
BUILDDIR=$1
fi
BUILDDIR=${BUILDDIR:-build}
./.gitlab-ci-filelist.sh $BUILDDIR
# Undefine this because not relevant in our configuration
#export UNDEFINITIONS="-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=missingInclude ${UNDEFINITIONS} --file-list=./filelist-c.txt 2> vite-cppcheck.xml
# run rats analysis
rats -w 3 --xml `cat filelist.txt` > vite-rats.xml
# Set the default for the project key
SONARQUBE_PROJECTKEY=${SONARQUBE_PROJECTKEY:-hiepacs:vite:gitlab:master}
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://sonarqube.bordeaux.inria.fr/sonarqube
sonar.login=$SONARQUBE_LOGIN
sonar.links.homepage=https://gitlab.inria.fr/solverstack/vite
sonar.links.scm=https://gitlab.inria.fr/solverstack/vite.git
sonar.links.ci=https://gitlab.inria.fr/solverstack/vite/pipelines
sonar.links.issue=https://gitlab.inria.fr/solverstack/vite/issues
sonar.projectKey=$SONARQUBE_PROJECTKEY
sonar.projectDescription=Parallel Sparse direct Solver
sonar.projectVersion=master
sonar.language=c++
sonar.sources=src, tests, plugins
sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'`
sonar.sourceEncoding=UTF-8
sonar.cxx.errorRecoveryEnabled=true
sonar.cxx.compiler.charset=UTF-8
sonar.cxx.compiler.parser=GCC
sonar.cxx.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
sonar.cxx.compiler.reportPath=vite-build.log
#sonar.cxx.coverage.reportPath=vite-coverage.xml
sonar.cxx.cppcheck.reportPath=vite-cppcheck.xml
sonar.cxx.rats.reportPath=vite-rats.xml
sonar.cxx.jsonCompilationDatabase=build/compile_commands.json
EOF
# run sonar analysis + publish on sonarqube-dev
sonar-scanner -X > sonar.log
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -394,34 +394,24 @@ IF(VITE_ENABLE_SERIALIZATION)
ENDIF(VITE_ENABLE_SERIALIZATION)
#############################################
# QT5
#############################################
IF(USE_QT5)
#############################################
# QT5
#############################################
QT5_WRAP_UI(VITE_UIS_H ${VITE_UIS})
QT5_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT5_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ELSE(USE_QT5)
#############################################
# QT4
#############################################
ELSE(USE_QT5)
QT4_AUTOMOC(${VITE_SRCS})
FOREACH(_hdrs_file ${VITE_HDRS})
GET_FILENAME_COMPONENT(_abs_file ${_hdrs_file} ABSOLUTE)
FILE(READ ${_abs_file} _contents)
STRING(REGEX MATCHALL "Q_OBJECT" _match "${_contents}")
IF(_match)
SET(VITE_MOC_HDRS ${VITE_MOC_HDRS} ${_hdrs_file})
ENDIF(_match)
ENDFOREACH(_hdrs_file ${VITE_HDRS})
QT4_WRAP_UI(VITE_UIS_H ${VITE_UIS})
QT4_WRAP_CPP(VITE_MOC ${VITE_UIS_H} ${VITE_MOC_HDRS})
QT4_ADD_RESOURCES(VITE_RCC_SRCS ${VITE_RCCS})
ENDIF(USE_QT5)
#############################################
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/common
......
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