Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a9f341bc authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Add CI

parent b94fbc7d
No related branches found
No related tags found
No related merge requests found
*~
*.o
*.a
*.pyc
_CPack_Packages
.#*
install_manifest.txt
TAGS
build*/
#################################################################
# https://github.com/github/gitignore/blob/master/C.gitignore
#################################################################
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
#################################################################
# https://github.com/github/gitignore/blob/master/CMake.gitignore
#################################################################
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
#################################################################
# https://github.com/github/gitignore/blob/master/Python.gitignore
#################################################################
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
#!/bin/sh
if [ $# -gt 0 ]
then
BUILDDIR=$1
fi
BUILDDIR=${BUILDDIR-=build}
SRCDIR_TO_ANALYZE="$BUILDDIR include src tests"
echo $PWD
rm -f filelist.txt
git ls-files | grep "\.[ch]" > filelist.txt
#git ls-files | grep "\.py" >> filelist.txt
find $BUILDDIR -name '*\.[ch]' >> filelist.txt
#echo "wrappers/python/examples/pypastix/enum.py" >> filelist.txt
# Remove all CMakeFiles generated file
#sed -i '/CMakeFiles/d' filelist.txt
# Remove installed files
sed -i '/^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 include/cblas.h include/lapacke.h
do
sed -i "\:^$file.*:d" filelist.txt
done
# Remove external driver files
for file in src/drivers/iohb.c src/drivers/iohb.h src/drivers/mmio.c src/drivers/mmio.h
do
sed -i "\:^$file.*:d" filelist.txt
done
image: hpclib/hiepacs
stages:
- build
- test
- sonar
- doc
build_spm:
stage: build
artifacts:
name: spm_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" -DPASTIX_INT64=OFF
- make -j 4 | tee ../pastix-build.log
- make install | tee -a ../pastix-build.log
only:
- branches
- master@solverstack/spm
test_spm:
stage: test
dependencies:
- build_spm
artifacts:
name: spm_test
expire_in: 42 minutes
paths:
- spm.lcov
- spm-gcov.log
script:
- (cd build &&
eval "ctest
$TESTS_RESTRICTION
-D ExperimentalTest
-D ExperimentalCoverage
-D ExperimentalSubmit
| tee -a ../spm-build.log")
- lcov --directory build --capture --output-file spm.lcov
- gcovr -r $PWD | tee spm-gcov.log
only:
- branches
- master@solverstack/spm
sonar_spm:
stage: sonar
dependencies:
- build_spm
- test_spm
artifacts:
name: spm_sonar
expire_in: 1 week
paths:
- spm.lcov
- coverage/
- spm-coverage.xml
- spm-cppcheck.xml
- spm-rats.xml
- sonar.log
script:
- ./tools/analysis.sh
only:
- master@solverstack/spm
pages:
stage: doc
dependencies:
- build_spm
script:
- git submodule update --init --recursive
- mkdir -p build
- cd build
- cmake .. -DBUILD_DOCUMENTATION=ON -DSPM_INT64=OFF
- make docs
- mv docs/out/html ../public/
artifacts:
paths:
- public
only:
- master@solverstack/spm
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# Performs an analysis of SpM source code:
# - we consider to be in SpM's source code root
# - we consider having the coverage file spm.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 spm and make cppcheck analysis too long
if [ $# -gt 0 ]
then
BUILDDIR=$1
fi
BUILDDIR=${BUILDDIR:-build}
./.gitlab-ci-filelist.sh $BUILDDIR
# Generate coverage xml output
lcov_cobertura.py spm.lcov --output spm-coverage.xml
# 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"
export UNDEFINITIONS="$UNDEFINITIONS -UPARSEC_PROF_DRY_BODY -UPARSEC_PROF_TRACE -UPARSEC_PROF_GRAPHER -UPARSEC_SIM -UPARSEC_DEBUG_NOISIER -DPINS_ENABLE"
# to get it displayed and captured by gitlab to expose the badge on the main page
cat ./spm-gcov.log
# run cppcheck analysis
cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} --file-list=./filelist.txt 2> spm-cppcheck.xml
# run rats analysis
rats -w 3 --xml `cat filelist.txt` > spm-rats.xml
# Set the default for the project key
SONARQUBE_PROJECTKEY=${SONARQUBE_PROJECTKEY:-hiepacs:spm:gitlab:dev}
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://sonarqube.bordeaux.inria.fr/
sonar.login=$SONARQUBE_LOGIN
sonar.links.homepage=https://gitlab.inria.fr/solverstack/spm
sonar.links.scm=https://gitlab.inria.fr/solverstack/spm.git
sonar.links.ci=https://gitlab.inria.fr/solverstack/spm/pipelines
sonar.links.issue=https://gitlab.inria.fr/solverstack/spm/issues
sonar.projectKey=$SONARQUBE_PROJECTKEY
sonar.projectDescription=Parallel Sparse direct Solver
sonar.projectVersion=master
sonar.language=c
sonar.sources=$BUILDDIR, bcsc, blend, common, example, graph, include, kernels, order, refinement, sopalin, spm, symbol, test
sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'`
sonar.sourceEncoding=UTF-8
sonar.c.errorRecoveryEnabled=true
sonar.c.compiler.charset=UTF-8
sonar.c.compiler.parser=GCC
sonar.c.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
sonar.c.compiler.reportPath=spm-build.log
sonar.c.coverage.reportPath=spm-coverage.xml
sonar.c.cppcheck.reportPath=spm-cppcheck.xml
sonar.c.rats.reportPath=spm-rats.xml
EOF
# run sonar analysis + publish on sonarqube-dev
sonar-scanner -X > sonar.log
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment