diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f75933dfe9f27bf2218896049fcb8955b553b713..cc1ed42584d8ec6a5680d1a4aa77f3ea3de791c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,14 +38,6 @@ stages: - runner_system_failure - stuck_or_timeout_failure -native-build: - extends: .general - only: [merge_requests] - stage: build - image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04 - script: - - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc - debian-build: extends: .general only: [merge_requests] @@ -57,9 +49,9 @@ debian-build: .common-build: extends: .general stage: build - image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-shark:18.04 + image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04 script: - - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-shark + - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm artifacts: paths: - build/CookBook-*-html.tar.gz diff --git a/CI/main_ci.cmake b/CI/main_ci.cmake index 64c72fb95ce501ec653cb5040925913ffc11d4da..1edbf1718ce81a666b2f65da919cc83113d09a4c 100644 --- a/CI/main_ci.cmake +++ b/CI/main_ci.cmake @@ -26,13 +26,22 @@ set (ENV{LANG} "C") # Only ascii output set (CTEST_BUILD_CONFIGURATION "Release") set (CTEST_CMAKE_GENERATOR "Ninja") +# detect short sha +if(NOT DEFINED ENV{CI_COMMIT_SHORT_SHA}) + execute_process(COMMAND git log -1 --pretty=format:%h + WORKING_DIRECTORY ${OTB_SOURCE_DIR} + OUTPUT_VARIABLE ci_short_sha) +else() + set(ci_short_sha "$ENV{CI_COMMIT_SHORT_SHA}") +endif() + # Find the build name and CI profile set(ci_profile wip) set(ci_mr_source "$ENV{CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}") set(ci_mr_target "$ENV{CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") set(ci_mr_iid "$ENV{CI_MERGE_REQUEST_IID}") set(ci_ref_name "$ENV{CI_COMMIT_REF_NAME}") -set (CTEST_BUILD_NAME "$ENV{CI_COMMIT_SHORT_SHA}") +set (CTEST_BUILD_NAME ${ci_short_sha}) if(ci_mr_source AND ci_mr_target AND ci_mr_iid) set (CTEST_BUILD_NAME "${ci_mr_source} (MR ${ci_mr_iid})") set(ci_profile mr) @@ -51,14 +60,26 @@ set(ci_doxygen_profiles mr develop release) list(FIND ci_cookbook_profiles ${ci_profile} ci_do_cookbook) list(FIND ci_doxygen_profiles ${ci_profile} ci_do_doxygen) -#Warning, this variable is used in cdash_status.py. If change from -# ${IMAGE_NAME} to something else do not forget to change it. +# Detect site +if(NOT DEFINED IMAGE_NAME) + if(DEFINED ENV{IMAGE_NAME}) + set(IMAGE_NAME $ENV{IMAGE_NAME}) + endif() +endif() set (CTEST_SITE "${IMAGE_NAME}") # Directory variable set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}") -set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/") -set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/") +if(BUILD_DIR) + set (CTEST_BINARY_DIRECTORY "${BUILD_DIR}") +else() + set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/") +endif() +if(INSTALL_DIR) + set (CTEST_INSTALL_DIRECTORY "${INSTALL_DIR}") +else() + set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/") +endif() set (PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}") # Ctest command value diff --git a/CI/ubuntu-18.04-gcc-shark.cmake b/CI/ubuntu-18.04-gcc-shark.cmake deleted file mode 100644 index b9ef2642b4890d8be17aabb164727bb70add5120..0000000000000000000000000000000000000000 --- a/CI/ubuntu-18.04-gcc-shark.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Configuration options for ubuntu-18.04-gcc-shark-3.1.4 - -set(site_option -"opencv_INCLUDE_DIR:PATH=/usr/include") diff --git a/CI/ubuntu-18.04-llvm-shark.cmake b/CI/ubuntu-18.04-llvm-shark.cmake deleted file mode 100644 index fb3b626a3b6dc9009793d75737f89008157b8d5e..0000000000000000000000000000000000000000 --- a/CI/ubuntu-18.04-llvm-shark.cmake +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) -# -# This file is part of Orfeo Toolbox -# -# https://www.orfeo-toolbox.org/ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Configuration options for ubuntu-18.04-llvm-shark-3.1.4 - -set(site_option -"opencv_INCLUDE_DIR:PATH=/usr/include -CMAKE_C_COMPILER:STRING=clang -CMAKE_CXX_COMPILER:STRING=clang++ -CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld -CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld -CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld -CMAKE_C_COMPILER_LAUNCHER:STRING=ccache -CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache -OTB_USE_SHARK:BOOL=OFF") - -if(NOT ${ci_do_cookbook} EQUAL -1) - set(site_option -"${site_option} -BUILD_COOKBOOK:BOOL=ON") -endif() - -if(NOT ${ci_do_doxygen} EQUAL -1) - set(site_option -"${site_option} -BUILD_DOCUMENTATION:BOOL=ON -OTB_DOXYGEN_ITK_TAGFILE:FILEPATH=${CTEST_BINARY_DIRECTORY}/InsightDoxygenDocTag-4.13.0 -OTB_DOXYGEN_ITK_DOXYGEN_URL:STRING=\"https://itk.org/Doxygen413/html\" -") - set (ENABLE_DOXYGEN ON) - # The ITK doxygen tag file needs to be patched before being used for OTB - # See otb-devutils/Scripts/tagfile_fix.py - message(STATUS "Get resources for Doxygen build ...") - execute_process(COMMAND wget https://www.orfeo-toolbox.org/packages/archives/Doxygen/InsightDoxygenDocTag-4.13.0.gz - COMMAND gzip -d InsightDoxygenDocTag-4.13.0.gz - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}) -endif() diff --git a/CI/ubuntu-18.04-llvm.cmake b/CI/ubuntu-18.04-llvm.cmake index a92364f2b45d82176aa65d3d112753055421aef1..6480ab2f31b9ddb22b56a15d61ac305a85e85423 100644 --- a/CI/ubuntu-18.04-llvm.cmake +++ b/CI/ubuntu-18.04-llvm.cmake @@ -22,9 +22,33 @@ set(site_option "opencv_INCLUDE_DIR:PATH=/usr/include -OTB_USE_SHARK:BOOL=OFF CMAKE_C_COMPILER:STRING=clang CMAKE_CXX_COMPILER:STRING=clang++ CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld -CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld") +CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld +CMAKE_C_COMPILER_LAUNCHER:STRING=ccache +CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache +OTB_USE_SHARK:BOOL=OFF") + +if(NOT ${ci_do_cookbook} EQUAL -1) + set(site_option +"${site_option} +BUILD_COOKBOOK:BOOL=ON") +endif() + +if(NOT ${ci_do_doxygen} EQUAL -1) + set(site_option +"${site_option} +BUILD_DOCUMENTATION:BOOL=ON +OTB_DOXYGEN_ITK_TAGFILE:FILEPATH=${CTEST_BINARY_DIRECTORY}/InsightDoxygenDocTag-4.13.0 +OTB_DOXYGEN_ITK_DOXYGEN_URL:STRING=\"https://itk.org/Doxygen413/html\" +") + set (ENABLE_DOXYGEN ON) + # The ITK doxygen tag file needs to be patched before being used for OTB + # See otb-devutils/Scripts/tagfile_fix.py + message(STATUS "Get resources for Doxygen build ...") + execute_process(COMMAND wget https://www.orfeo-toolbox.org/packages/archives/Doxygen/InsightDoxygenDocTag-4.13.0.gz + COMMAND gzip -d InsightDoxygenDocTag-4.13.0.gz + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}) +endif()