2016-06-22 16:26:05 +05:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
2016-07-11 15:08:06 +05:00
|
|
|
- deploy
|
2016-06-22 16:26:05 +05:00
|
|
|
- cleanup
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# System templates
|
|
|
|
############################################
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
.template_windows_32: &win32
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
- x86
|
|
|
|
before_script:
|
|
|
|
- "echo off"
|
|
|
|
- 'call "%VS140COMNTOOLS%\..\..\VC\bin\vcvars32.bat"'
|
|
|
|
- set CMAKE_GENERATOR=Visual Studio 14 2015
|
2017-01-31 18:12:22 +05:00
|
|
|
- set CI_DIR=C:\ci\%CI_BUILD_REF%_32
|
|
|
|
- set NETGEN_BUILD_DIR=%CI_DIR%\build
|
|
|
|
- set INSTALL_DIR=%CI_DIR%\install
|
|
|
|
- set NETGENDIR=%INSTALL_DIR%\bin
|
|
|
|
- set PYTHONPATH=%INSTALL_DIR%\lib\site-packages
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
.template_windows_64: &win64
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
- x64
|
|
|
|
before_script:
|
|
|
|
- "echo off"
|
|
|
|
- 'call "%VS140COMNTOOLS%\..\..\VC\bin\amd64\vcvars64.bat"'
|
|
|
|
- set CMAKE_GENERATOR=Visual Studio 14 2015 Win64
|
2017-01-31 18:12:22 +05:00
|
|
|
- set CI_DIR=C:\ci\%CI_BUILD_REF%_64
|
|
|
|
- set NETGEN_BUILD_DIR=%CI_DIR%\build
|
|
|
|
- set INSTALL_DIR=%CI_DIR%\install
|
|
|
|
- set NETGENDIR=%INSTALL_DIR%\bin
|
|
|
|
- set PYTHONPATH=%INSTALL_DIR%\lib\site-packages
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
# Linux
|
|
|
|
.template_ubuntu: &ubuntu
|
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
before_script:
|
|
|
|
- pwd
|
|
|
|
- ls
|
|
|
|
- docker info
|
|
|
|
|
2018-12-10 14:57:56 +05:00
|
|
|
.template_ubuntu: &ubuntu
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *ubuntu
|
|
|
|
variables:
|
2018-12-10 14:57:56 +05:00
|
|
|
UBUNTU_VERSION: "18.04"
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
############################################
|
|
|
|
# Build stage
|
|
|
|
############################################
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
.template_build_win: &tbuild_netgen_win
|
|
|
|
stage: build
|
|
|
|
script:
|
2017-01-31 18:12:22 +05:00
|
|
|
- git submodule update --init --recursive
|
|
|
|
- rd /s /q %NETGEN_BUILD_DIR%
|
|
|
|
- mkdir %NETGEN_BUILD_DIR%
|
|
|
|
- cd %NETGEN_BUILD_DIR%
|
2016-06-22 16:26:05 +05:00
|
|
|
- >-
|
2017-01-31 18:12:22 +05:00
|
|
|
cmake %CI_PROJECT_DIR%
|
2016-06-22 16:26:05 +05:00
|
|
|
-G"%CMAKE_GENERATOR%"
|
2017-01-31 18:12:22 +05:00
|
|
|
-DINSTALL_DIR=%INSTALL_DIR%
|
2016-06-22 16:26:05 +05:00
|
|
|
-DUSE_OCC=ON
|
2016-12-22 23:12:11 +05:00
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
2016-06-22 16:26:05 +05:00
|
|
|
- cmake --build . --target INSTALL --config Release
|
|
|
|
|
2017-04-07 13:14:00 +05:00
|
|
|
.build_netgen_win32:
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *win32
|
|
|
|
<<: *tbuild_netgen_win
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- build/
|
|
|
|
- src/
|
2016-07-11 17:59:30 +05:00
|
|
|
key: "netgen_win32_${CI_BUILD_REF_NAME}"
|
2016-06-22 16:26:05 +05:00
|
|
|
|
2016-06-22 16:27:26 +05:00
|
|
|
build_netgen_win64:
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *win64
|
|
|
|
<<: *tbuild_netgen_win
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- build/
|
|
|
|
- src/
|
2016-07-11 17:59:30 +05:00
|
|
|
key: "netgen_win64_${CI_BUILD_REF_NAME}"
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
# Linux
|
|
|
|
.template_build_linux: &build_linux
|
|
|
|
stage: build
|
|
|
|
script:
|
2018-12-10 14:57:56 +05:00
|
|
|
- docker build -t netgen_${CI_BUILD_REF_NAME}:${UBUNTU_VERSION} -f tests/dockerfile .
|
2016-07-11 17:59:30 +05:00
|
|
|
- rm -f netgen_${CI_BUILD_REF_NAME}_$UBUNTU_VERSION.id
|
|
|
|
- docker run --cidfile netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id -e CCACHE_DIR=/ccache -v /mnt/ccache:/ccache netgen_${CI_BUILD_REF_NAME}:${UBUNTU_VERSION} bash /root/src/netgen/tests/build.sh
|
|
|
|
- docker commit `cat netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id` netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
|
|
|
- rm netgen_${CI_BUILD_REF_NAME}_${UBUNTU_VERSION}.id
|
2016-06-22 16:26:05 +05:00
|
|
|
|
2018-12-10 14:57:56 +05:00
|
|
|
build_ubuntu:
|
|
|
|
<<: *ubuntu
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *build_linux
|
|
|
|
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test stage
|
|
|
|
############################################
|
|
|
|
|
|
|
|
# Windows
|
2017-01-31 18:12:22 +05:00
|
|
|
.template_test_win: &test_win
|
2016-06-22 16:26:05 +05:00
|
|
|
stage: test
|
|
|
|
script:
|
2017-01-31 18:12:22 +05:00
|
|
|
- cd %NETGEN_BUILD_DIR%/netgen
|
2016-06-22 16:26:05 +05:00
|
|
|
- ctest -C Release -V
|
2017-01-31 18:12:22 +05:00
|
|
|
- cd ..
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
# skip since we have no machine with 32 bits
|
2017-04-07 13:14:00 +05:00
|
|
|
.test_win32:
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *win32
|
2017-01-31 18:12:22 +05:00
|
|
|
<<: *test_win
|
2016-06-22 16:26:05 +05:00
|
|
|
|
2017-01-31 18:12:22 +05:00
|
|
|
test_win64:
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *win64
|
2017-01-31 18:12:22 +05:00
|
|
|
<<: *test_win
|
2016-06-22 16:26:05 +05:00
|
|
|
|
|
|
|
# Linux
|
|
|
|
.template_test_linux: &test_linux
|
|
|
|
stage: test
|
|
|
|
script:
|
2017-02-23 20:41:27 +05:00
|
|
|
- >-
|
|
|
|
docker run
|
|
|
|
-e NETGENDIR=/opt/netgen/bin
|
|
|
|
-e PYTHONPATH=/opt/netgen/lib/python3/dist-packages
|
|
|
|
netgen_${CI_BUILD_REF_NAME}_installed:${UBUNTU_VERSION}
|
|
|
|
bash -c 'cd /root/build/netgen && make test_netgen ARGS="-V"'
|
2016-06-22 16:26:05 +05:00
|
|
|
|
2018-12-10 14:57:56 +05:00
|
|
|
test_ubuntu:
|
|
|
|
<<: *ubuntu
|
2016-06-22 16:26:05 +05:00
|
|
|
<<: *test_linux
|
|
|
|
|
2016-07-11 15:08:06 +05:00
|
|
|
############################################
|
|
|
|
# Deploy stage
|
|
|
|
############################################
|
|
|
|
|
2017-03-16 19:11:43 +05:00
|
|
|
deploy_sourceforge:
|
|
|
|
stage: deploy
|
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- git remote add sourceforge ssh://mhochste@git.code.sf.net/p/netgen-mesher/git || true
|
2017-07-18 14:53:52 +05:00
|
|
|
- git remote add github git@github.com:NGSolve/netgen.git || true
|
2017-03-16 19:11:43 +05:00
|
|
|
- git remote update
|
|
|
|
- git checkout master
|
|
|
|
- git pull origin master
|
|
|
|
- git push sourceforge master
|
2017-07-18 14:53:52 +05:00
|
|
|
- git push github master
|
2017-03-16 19:11:43 +05:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
2016-06-22 16:26:05 +05:00
|
|
|
############################################
|
|
|
|
# Cleanup stage
|
|
|
|
############################################
|
|
|
|
|
|
|
|
linux_cleanup:
|
|
|
|
stage: cleanup
|
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
script:
|
|
|
|
# remove intermediate and old docker images and containers
|
2016-06-29 13:34:25 +05:00
|
|
|
- docker rm -f `docker ps --no-trunc -aq`
|
2016-06-22 16:26:05 +05:00
|
|
|
- docker images --no-trunc -aqf "dangling=true" | xargs docker rmi -f
|
|
|
|
when: always
|
2016-07-11 15:08:06 +05:00
|
|
|
allow_failure: true
|
2016-06-22 16:26:05 +05:00
|
|
|
|
2017-01-31 18:12:22 +05:00
|
|
|
win64_cleanup:
|
|
|
|
<<: *win64
|
|
|
|
stage: cleanup
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
- x64
|
|
|
|
script:
|
|
|
|
- cd %CI_PROJECT_DIR%
|
|
|
|
- rd /s /q %CI_DIR%
|
|
|
|
when: always
|
|
|
|
allow_failure: true
|
|
|
|
|
2017-04-07 13:14:00 +05:00
|
|
|
.win32_cleanup:
|
2017-01-31 18:12:22 +05:00
|
|
|
<<: *win32
|
|
|
|
stage: cleanup
|
|
|
|
tags:
|
|
|
|
- windows
|
|
|
|
- x86
|
|
|
|
script:
|
|
|
|
- cd %CI_PROJECT_DIR%
|
|
|
|
- rd /s /q %CI_DIR%
|
|
|
|
when: always
|
|
|
|
allow_failure: true
|
|
|
|
|