24/09/2020 : le runner partagé est actuellement indisponible.

Commit 32c2e525 authored by Emmanuel Promayon's avatar Emmanuel Promayon

Merge branch 'feature/docker-on-windows' into 'develop'

docker for CI on windows

See merge request !149
parents 35a9a33b dc019948
#!/bin/bash
if [ "$OS" == "win7" ]; then
if [ "$OS" == "win10" ]; then
# there is no docker on windows
CONTAINER_ID=0
else
......@@ -55,10 +55,10 @@ if [[ "$MESSAGE_COVERAGE" == "true" || "$CAMITK_CI_STAGE" -ge $STAGE_COVERAGE ]]
fi
CMAKE_VERSION=$(cmake --version | grep version | cut -c15- )
if [[ "$OS" != "win7" ]]; then
if [[ "$OS" != "win10" ]]; then
OS_FULL_NAME=$(grep PRETTY_NAME /etc/*rel* | cut -f2 -d\" )
else
OS_FULL_NAME="Win7"
OS_FULL_NAME="Win10"
fi
QT_VERSION=$(qmake --version | grep Qt | cut -f4 -d" " )
......
......@@ -17,7 +17,7 @@ fi
echo "===== build ====="
if [ "$OS" == "win7" ]; then
if [ "$OS" == "win10" ]; then
# there is no xvfb on windows
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
......
......@@ -22,7 +22,7 @@ if [ "$CAMITK_CI_MODE" == "Nightly" ]; then
echo "Nightly Build, start from scratch";
fi
if [[ "$OS" != "win7" ]]; then
if [[ "$OS" != "win10" ]]; then
echo "===== Configuring xvfb ====="
# Starts the server first (try to avoid unexpected and random "QXcbConnection: Could not connect to display :99")
# see also https://doc.qt.io/qt-5/embedded-linux.html#linuxfb
......@@ -36,7 +36,7 @@ fi
echo "===== Running configure stage ====="
# there is no xvfb on windows
if [ "$OS" == "win7" ]; then
if [ "$OS" == "win10" ]; then
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
......
......@@ -110,7 +110,7 @@ stages:
<<: *skip_when_packaging
before_script:
# use Linux before script
- .gitlab/before.sh
- bash .gitlab/before.sh
# -------------------------------------
# scripts
......@@ -119,31 +119,31 @@ stages:
stage: check
script:
# use Linux check script
- .gitlab/check.sh
- bash .gitlab/check.sh
.define_script: &configure_script
stage: configure
script:
# use Linux configure script
- .gitlab/configure.sh
- bash .gitlab/configure.sh
.define_script: &build_script
stage: build
script:
# use Linux build script
- .gitlab/build.sh
- bash .gitlab/build.sh
.define_script: &test_script
stage: test
script:
# use Linux test script
- .gitlab/test.sh
- bash .gitlab/test.sh
.define_script: &coverage_script
stage: coverage
script:
# use Linux coverage script
- .gitlab/coverage.sh
- bash .gitlab/coverage.sh
# -------------------------------------
# artifacts config
......@@ -341,44 +341,45 @@ debian_oldstable_coverage:
# -------------------------------------
# win7 jobs
# win10 jobs
# -------------------------------------
.define_os: &win7_config
# on windows the executor is just a shell (not a docker)
.define_os: &win10_config
# on windows the executor is a docker
image: gricad-registry.univ-grenoble-alpes.fr/camitk/camitk/win10-msvc2019-2020-06-19-v0
variables:
# OS Id
OS: "win7"
OS: "win10"
# the name of the current machine
CDASH_SITE: "[Gitlab Runner] Win7"
CDASH_SITE: "[Gitlab Runner] Win10"
# compiler-arch-buildtype string (Ninja would be better instead of MSVC2015 to speed up compilation on VM)
COMPILER_CONFIG: "MSVC2015-64bits-Debug"
COMPILER_CONFIG: "MSVC2019-64bits-Debug"
# path to the intended build directory
PROJECT_BUILD_DIR: "/c/dev/gitlab-runner/builds/${OS}-${CI_COMMIT_REF_SLUG}"
PROJECT_BUILD_DIR: "C:/builds/${OS}-${CI_COMMIT_REF_SLUG}"
# path to the intended log directory (cannot be an absolute path)
PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log"
tags:
- win7
- win10
win7_check:
<<: *win7_config
win10_check:
<<: *win10_config
<<: *default_job_config
<<: *check_pipeline_script
win7_configure:
<<: *win7_config
win10_configure:
<<: *win10_config
<<: *default_job_config
<<: *configure_artifacts
<<: *configure_script
win7_build:
<<: *win7_config
win10_build:
<<: *win10_config
<<: *default_job_config
<<: *build_artifacts
<<: *build_script
win7_test:
<<: *win7_config
win10_test:
<<: *win10_config
<<: *default_job_config
<<: *test_artifacts
<<: *test_script
......
......@@ -8,10 +8,10 @@ export CAMITK_CI_MODE="Experimental"
export CAMITK_CI_STAGE=70
export CI_JOB_NAME="manual-$(date +%Y-%m-%d-%H:%M)"
if [[ "$OS" != "win7" ]]; then
if [[ "$OS" != "win10" ]]; then
OS_FULL_NAME=$(grep PRETTY_NAME /etc/*rel* | cut -f2 -d\" )
else
OS_FULL_NAME="Win7"
OS_FULL_NAME="Win10"
fi
export OS=$OS_FULL_NAME
......
......@@ -24,7 +24,7 @@ function cleanup-apt-post() {
apt-get -qq clean > /dev/null
}
if [ "$OS" == "win7" ]; then
if [ "$OS" == "win10" ]; then
# there is no docker on windows
CONTAINER_ID=0
else
......
......@@ -17,7 +17,7 @@ if ! grep -q TRIGGER_STAGE_TEST "${PROJECT_LOG_DIR}/trigger-stage.txt"; then
exit 1;
fi
if [[ "$OS" != "win7" ]]; then
if [[ "$OS" != "win10" ]]; then
echo "===== Configuring xvfb =====" > >(tee --append ${PROJECT_LOG_DIR}/test.log) 2>&1
# Starts the server first (try to avoid unexpected and random "QXcbConnection: Could not connect to display :99")
export DISPLAY=":98"
......@@ -63,7 +63,7 @@ ctest --extra-verbose \
# -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
# -S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee --append ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1
#
# if [[ "$OS" != "win7" ]]; then
# if [[ "$OS" != "win10" ]]; then
# # shutdown xvfb
# kill $xvfbPid
# fi
......
......@@ -246,8 +246,10 @@ generateConfigureAndMake() {
cd build
echo "===== configuring... ====="
if [[ "$osName" == "Windows" ]]; then
# no virtual X11 -DCMAKE_C_FLAGS:STRING="/MP" -DCMAKE_CXX_FLAGS="/MP"
cmake $CMAKE_OPTIONS -Wno-dev -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE:STRING=Debug ../$srcDirName > ../cmake-log 2> ../cmake-error
# use the currently supported visual studio version (64 bit) with the Debug config
#cmake $CMAKE_OPTIONS -Wno-dev -G "Visual Studio 16 2019" -A x64 --config Debug ../$srcDirName > ../cmake-log 2> ../cmake-error
# choose the default msvc version and config from current install
cmake $CMAKE_OPTIONS -Wno-dev --config Debug ../$srcDirName > ../cmake-log 2> ../cmake-error
else
cmake $CMAKE_OPTIONS ../$srcDirName > ../cmake-log 2> ../cmake-error
fi
......@@ -262,7 +264,7 @@ generateConfigureAndMake() {
echo "===== building... ====="
if [[ "$osName" == "Windows" ]]; then
cmake --build . --config Debug > ../make-log 2> ../make-error
cmake --build . --config Debug --parallel 9 > ../make-log 2> ../make-error
else
# build (parallel)
make -j9 > ../make-log 2> ../make-error
......
......@@ -95,13 +95,15 @@ elseif(WIN32)
set(CMAKE_CXX_FLAGS "/EHsc ${CMAKE_CXX_FLAGS}")
elseif(COMPILER MATCHES "MSVC2017" AND ARCH MATCHES "64bits")
set(CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64" )
elseif(COMPILER MATCHES "MSVC2019") # only 64 bit supports
set(CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
elseif(COMPILER MATCHES "Ninja")
set(CTEST_CMAKE_GENERATOR "Ninja")
# ninja cannot find the compiler
#set(ENV{CC} "cl.exe")
#set(ENV{CXX} "cl.exe")
else()
message(FATAL_ERROR "CTEST COMPILER ERROR : No proper compiler found, please check ctest command syntax.")
message(FATAL_ERROR "CTEST COMPILER ERROR : No proper or supported compiler found, please check ctest command syntax or update this script.")
endif()
endif()
......
......@@ -9,11 +9,14 @@
# XSD_VERSION the xsd version that was found
# XSD_CXX_STD_FLAG force to C++11 if and only if xsd version is greater or equals to 4.0.0, empty string otherwise
find_path(XSD_INCLUDE_DIR
find_path(XSD_INCLUDE_DIR
NAMES "xsd/cxx/parser/elements.hxx"
PATHS "[HKEY_CURRENT_USER\\software\\xsd\\include]"
"[HKEY_CURRENT_USER]\\xsd\\include]"
$ENV{XSDDIR}/include
$ENV{XSDDIR}/libxsd # from the win binary package install
$ENV{XSD_DIR}/include
$ENV{XSD_DIR}/libxsd # from the win binary package install
$ENV{XERCESC_ROOT_DIR}/include
$ENV{XERCESC_DIR}/include
${XERCESC_INCLUDE_DIR}
......@@ -25,14 +28,28 @@ find_path(XSD_INCLUDE_DIR
# check if the plateform can compile the xsd automatically
find_program(XSD_EXECUTABLE
NAMES xsdcxx xsd
PATHS "[HKEY_CURRENT_USER\\xsd\\bin"
NAMES xsdcxx
PATHS $ENV{XSD_DIR}/bin
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
${CMAKE_FIND_ROOT_PATH}/bin
)
# take into account a binary install on Windows)
if (NOT XSD_EXECUTABLE)
message(STATUS "xsdcxx not found, looking for xsd binary")
find_program(XSD_EXECUTABLE
NAMES xsd
PATHS "[HKEY_CURRENT_USER\\xsd\\bin"
$ENV{XSD_DIR}/bin
$ENV{XSDDIR}/bin
/usr/local/bin
/usr/bin
${CMAKE_FIND_ROOT_PATH}/bin
)
endif()
# if the include and the program are found then it is installed and found
if(XSD_INCLUDE_DIR)
if(XSD_EXECUTABLE)
......@@ -60,11 +77,12 @@ if(XSD_FOUND)
if(NOT XSD_FIND_QUIETLY)
string(REGEX REPLACE "\n$" "" XSD_VERSION_WITHOUT_TRAILING_NEWLINE "${XSD_VERSION}")
message(STATUS "Found XSD executable: ${XSD_EXECUTABLE} version ${XSD_VERSION_WITHOUT_TRAILING_NEWLINE}")
message(STATUS "Found XSD executable \"${XSD_EXECUTABLE}\" version ${XSD_VERSION_WITHOUT_TRAILING_NEWLINE}")
message(STATUS "Found XSD headers in ${XSD_INCLUDE_DIR}")
endif()
else()
if(XSD_FIND_REQUIRED)
message(FATAL_ERROR "Cannot find xsdcxx command: please install XSD / check xsd binary is in your sytem PATH.")
message(FATAL_ERROR "Cannot find xsdcxx command: please install XSD / check xsd binary is in your sytem PATH.\n XSDDIR is set to $ENV{XSD_DIR}\nXSD_INCLUDE_DIR is ${XSD_INCLUDE_DIR}\nXSD_EXECUTABLE is ${XSD_EXECUTABLE}")
endif()
endif()
......
......@@ -18,6 +18,7 @@ FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
# try to find the header
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
$ENV{XERCESC_DIR}/include
${XERCESC_ROOT_DIR}/include
/usr/include
/usr/local/include
......@@ -27,6 +28,7 @@ FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
FIND_LIBRARY(XERCESC_LIBRARY
NAMES xerces-c_3 xerces-c
PATHS
$ENV{XERCESC_DIR}/lib
${XERCESC_ROOT_DIR}/lib
/usr/lib
/usr/local/lib
......
......@@ -5,3 +5,11 @@ camitk_extension(COMPONENT_EXTENSION
ENABLE_AUTO_TEST
TEST_FILES head1.STL skull1.stl
)
camitk_tests_requirement(TESTS component-stl-level3-1
component-stl-level3-2
REQUIRES "${VTK_VERSION} VERSION_LESS 8.2"
REASON "VTK version is 8.2 or above 6.3
The default test files are written using the VTK version 6.3 or 7.1 in mind.
This test will therefore fail when comparing the input to the output if another version of VTK is used."
)
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