Skip to content
Snippets Groups Projects
Commit cf72df80 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

[GitLabCI] Add initial CI.

parent 67192853
No related branches found
No related tags found
No related merge requests found
###############################################################################
# Aidge Continious Integration and Continious Deployment #
# #
###############################################################################
stages:
# Analyse code
- static_analysis
# Build Aidge
- build
# Unit test stage
- test
include:
- local: '/.gitlab/ci/_global.gitlab-ci.yml'
- local: '/.gitlab/ci/static_analysis.gitlab-ci.yml'
- local: '/.gitlab/ci/build.gitlab-ci.yml'
- local: '/.gitlab/ci/test.gitlab-ci.yml'
################################################################################
# Centralized definitions of common job parameter values. #
# Parameters with many optional configurations may be in separate files. #
# #
################################################################################
variables:
GIT_SUBMODULE_STRATEGY: recursive
OMP_NUM_THREADS: 4
GIT_SSL_NO_VERIFY: 1
DEBIAN_FRONTEND: noninteractive
image: n2d2-ci/ubuntu20.04/cpu:latest
\ No newline at end of file
build:ubuntu_cpp:
stage: build
tags:
- docker
image: n2d2-ci/ubuntu20.04/cpu:latest
script:
- mkdir -p build_cpp
- mkdir -p install_cpp
- cd build_cpp
- cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON ..
- make -j4 all install
artifacts:
paths:
- build_cpp/
- install_cpp/
build:ubuntu_python:
stage: build
tags:
- docker
image: n2d2-ci/ubuntu20.04/cpu:latest
script:
- python3 -m pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- export AIDGE_INSTALL=`pwd`/install
- python3 -m pip install .
artifacts:
paths:
- venv/
\ No newline at end of file
static_analysis:cpp:
stage: static_analysis
tags:
- static_analysis
allow_failure: true
script:
- mkdir -p $CI_COMMIT_REF_NAME
- cppcheck -j 4 --enable=all --inconclusive --force --xml --xml-version=2 . 2> cppcheck-result.xml
- python -m pip install Pygments
- cppcheck-htmlreport --file=cppcheck-result.xml --report-dir=$CI_COMMIT_REF_NAME --source-dir=src
- python3 -m pip install -U cppcheck_codequality
- cppcheck-codequality --input-file=cppcheck-result.xml --output-file=cppcheck.json
- mkdir -p public/cpp
- mv $CI_COMMIT_REF_NAME public/cpp/
artifacts:
paths:
- public
reports:
codequality: cppcheck.json
static_analysis:python:
stage: static_analysis
tags:
- static_analysis
allow_failure: true
script:
- pip install pylint
- pip install pylint-gitlab
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter aidge_backend_cpu/ > codeclimate.json
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter aidge_backend_cpu/ > pylint.html
- mkdir -p public/python/$CI_COMMIT_REF_NAME
- mv pylint.html public/python/$CI_COMMIT_REF_NAME/
artifacts:
paths:
- public
reports:
codequality: codeclimate.json
\ No newline at end of file
test:ubuntu_cpp:
stage: test
needs: ["build:ubuntu_cpp"]
tags:
- docker
image: n2d2-ci/ubuntu20.04/cpu:latest
script:
- cd build_cpp
- ctest --output-on-failure
test:ubuntu_python:
stage: test
needs: ["build:ubuntu_python"]
tags:
- docker
image: n2d2-ci/ubuntu20.04/cpu:latest
script:
- source venv/bin/activate
- cd aidge_backend_cpu
- python3 -m pip list
# Run on discovery all tests located in core/unit_tests/python and discard the stdout
# only to show the errors/warnings and the results of the tests
- python3 -m unittest discover -s unit_tests/ -v -b 1> /dev/null
.pylintrc 0 → 100644
This diff is collapsed.
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