Newer
Older
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- _skbuild
- _skbuild/
- Python/venv
before_script:
- python3 -m venv --system-site-packages Python/venv
- source Python/venv/bin/activate
script:
- python3 setup.py install
build_singularity_image:
stage: build
rules:
- if: $CI_COMMIT_TAG
artifacts:
paths:
- Containers/VirtualFluidsOpenMPI.sif
script:
- singularity build Containers/VirtualFluidsOpenMPI.sif Containers/VirtualFluidsOpenMPI.def
- ls -sh Containers/VirtualFluidsOpenMPI.sif
- export VF_UNITTESTS=$(find _skbuild -name basicsTests)
artifacts:
when: on_failure
paths:
- output/mq/mq10000/
- export PYTHONPATH="Python"
- source Python/venv/bin/activate
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo $SSH_PRIVATE_KEY >> ansible/private_key
- ssh-keyscan -t rsa phoenix.hlr.rz.tu-bs.de >> ~/.ssh/known_hosts
- ansible-playbook -i ansible/hosts.cfg -u $REMOTE_USER ansible/playbook.yml
parallel:
matrix:
- ANSIBLE_MATRIX: 0
REMOTE_USER:
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Creating release with tag $CI_COMMIT_TAG"
- release-cli create --name "VirtualFluids $CI_COMMIT_TAG" \
--description "VirtualFluids CFD Simulator" \
--tag-name "$CI_COMMIT_TAG" \
--ref "$CI_COMMIT_SHA" \
--job-token "$CI_JOB_TOKEN" \
--assets-link="{'name':'VirtualFluidsSingularityImage_OpenMPI','url':'','type':'other','filepath':'Containers/VirtualFluidsOpenMPI.sif'}"
- build/bin/basicsTests
###############################################################################
## ##
## Deploy: Code analysis ##
## ##
###############################################################################
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- cmake --version
- mpirun --version
- export CC=clang
- export CXX=clang++
- $CXX --version
- cd /tmp
- git clone https://github.com/aras-p/ClangBuildAnalyzer.git
- cd ClangBuildAnalyzer
- cmake .
- make
- export PATH+=:$(pwd)
script:
- mkdir $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake .. -DBUILD_VF_CPU=ON -DUSE_OPENMP=OFF -DCMAKE_CXX_FLAGS=-ftime-trace
- ClangBuildAnalyzer --start .
- make
- ClangBuildAnalyzer --stop . CBA
- ClangBuildAnalyzer --analyze CBA
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- cd /tmp
- git clone https://github.com/include-what-you-use/include-what-you-use.git
- cd include-what-you-use
- git checkout clang_10
- cmake . -DCMAKE_PREFIX_PATH=/usr/lib/llvm-10
- make
- export PATH+=:$(pwd)/bin
script:
- mkdir $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake .. -DBUILD_VF_CPU=ON -DUSE_OPENMP=OFF -DBUILD_VF_INCLUDE_WHAT_YOU_USE=ON
- make
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
script:
- cd $CI_PROJECT_DIR
- cppcheck --version
- cppcheck src --enable=all --xml 2> report.xml
- cppcheck-htmlreport --file=report.xml --report-dir=html_report --source-dir=.
deploy_cppcheck_to_elladan:
stage: deploy
needs: ["cppcheck"]
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_ELLADAN" | tr -d '\r' | ssh-add -
- ssh-keyscan -t rsa elladan.irmb.bau.tu-bs.de >> ~/.ssh/known_hosts
- pip3 install ansible
script:
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_cppcheck.yml
# lizard - Cyclomatic Complexity Analyzer
# Ignore warnings is manually set to 191. This job will fail when new warnings are added.
lizard:
stage: test
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- cd /tmp
- git clone https://github.com/terryyin/lizard.git
- cd lizard
- which lizard
- lizard --version
script:
- cd $CI_PROJECT_DIR
- lizard -l cpp src/ > lizard.txt --ignore_warnings 191
# code coverage
gcov:
stage: test
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- pip3 install gcovr
- gcovr --version
- apt-get install -y libboost-serialization-dev
- cd /tmp
- apt-get install unzip
- wget https://github.com/NVIDIA/cuda-samples/archive/10.1.2.zip
- unzip 10.1.2.zip
- export NVCUDASAMPLES_ROOT=$(pwd)/cuda-samples-10.1.2
- cd $CI_PROJECT_DIR/gcov_build
- cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=ON -DBUILD_VF_COVERAGE=ON -DBUILD_VF_UNIT_TESTS=ON
- make -j4
- ./bin/basicsTests
- cd ..
- mkdir coverage
- gcovr -r $CI_PROJECT_DIR -k gcov_build -f "src" --print-summary --html coverage/coverage.html --html-details --xml coverage/coverage.xml
- gcov_build/
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG-gcov"
paths:
- gcov_build/
deploy_gcov_to_elladan:
stage: deploy
needs: ["gcov"]
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_ELLADAN" | tr -d '\r' | ssh-add -
- ssh-keyscan -t rsa elladan.irmb.bau.tu-bs.de >> ~/.ssh/known_hosts
- pip3 install ansible
script:
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_gcov.yml
# windows
windows:
stage: build
tags:
- windows10
before_script:
- git --version
- $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
- MSBuild.exe -version
- cmake .. -DBUILD_VF_CPU=OFF -DBUILD_VF_GPU=ON -DBUILD_VF_UNIT_TESTS=ON -G "$env:CMAKE_GENERATOR" ..
- MSBuild.exe VirtualFluids.sln /property:Configuration=$env:BUILD_CONFIGURATION /verbosity:minimal /maxcpucount:4

Soeren Peters
committed
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG-windows"
paths:
- $CI_PROJECT_DIR/build/