Skip to content
Snippets Groups Projects
Commit 943cfaa5 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

Merge branch 'ci_refactor_yml' into 'develop'

CI: need to simplify CI scripts

See merge request orfeotoolbox/otb!423
parents 6615603d 61086de7
Branches
Tags
No related merge requests found
...@@ -22,60 +22,9 @@ native-build: ...@@ -22,60 +22,9 @@ native-build:
script: script:
- ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc - ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-gcc
.build-common: build:ubuntu-llvm:
extends: .general extends: .general
stage: build stage: build
image: registry.orfeo-toolbox.org/gbonnefille/otb-build-env/otb-ubuntu-shark:18.04 image: registry.orfeo-toolbox.org/gbonnefille/otb-build-env/otb-ubuntu-shark:18.04
before_script:
# ccache configuration
- mkdir -p ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
- echo "max_size = 3G" > ccache/ccache.conf
- echo "run_second_cpp = true" >> ccache/ccache.conf
- echo "compiler_check = content" >> ccache/ccache.conf
- echo "sloppiness = time_macros" >> ccache/ccache.conf
script: script:
- ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-shark - ctest -VV -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-shark
cache:
key: "ubuntu-18.04-llvm-shark"
paths:
- ccache/
build-wip:
extends: .build-common
variables:
OTB_CI_PROFILE: 'wip'
except:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
cache:
policy: pull
build-mr:
extends: .build-common
variables:
OTB_CI_PROFILE: 'mr'
only:
- merge_requests
cache:
policy: pull
build-develop:
extends: .build-common
variables:
OTB_CI_PROFILE: 'develop'
only:
- develop
cache:
policy: pull-push
build-release:
extends: .build-common
variables:
OTB_CI_PROFILE: 'release'
only:
- /^release-[0-9]+\.[0-9]+$/
cache:
policy: pull
...@@ -26,15 +26,22 @@ set (ENV{LANG} "C") # Only ascii output ...@@ -26,15 +26,22 @@ set (ENV{LANG} "C") # Only ascii output
set (CTEST_BUILD_CONFIGURATION "Release") set (CTEST_BUILD_CONFIGURATION "Release")
set (CTEST_CMAKE_GENERATOR "Ninja") set (CTEST_CMAKE_GENERATOR "Ninja")
# Find the build name # 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_source "$ENV{CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}")
set(ci_mr_target "$ENV{CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") set(ci_mr_target "$ENV{CI_MERGE_REQUEST_TARGET_BRANCH_NAME}")
set(ci_ref_name "$ENV{CI_COMMIT_REF_NAME}") set(ci_ref_name "$ENV{CI_COMMIT_REF_NAME}")
set (CTEST_BUILD_NAME "$ENV{CI_COMMIT_SHORT_SHA}") set (CTEST_BUILD_NAME "$ENV{CI_COMMIT_SHORT_SHA}")
if(ci_mr_source AND ci_mr_target) if(ci_mr_source AND ci_mr_target)
set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME} (${ci_mr_source} to ${ci_mr_target})") set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME} (${ci_mr_source} to ${ci_mr_target})")
set(ci_profile mr)
elseif(ci_ref_name) elseif(ci_ref_name)
set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME} (${ci_ref_name})") set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME} (${ci_ref_name})")
if("${ci_ref_name}" STREQUAL "develop")
set(ci_profile develop)
elseif("${ci_ref_name}" MATCHES "^release-[0-9]+\\.[0-9]+\$")
set(ci_profile release)
endif()
endif() endif()
set (CTEST_SITE "${IMAGE_NAME}") set (CTEST_SITE "${IMAGE_NAME}")
...@@ -52,7 +59,7 @@ set (CMAKE_COMMAND "cmake") ...@@ -52,7 +59,7 @@ set (CMAKE_COMMAND "cmake")
set (OTB_DATA_ROOT "${OTB_SOURCE_DIR}/otb-data/") # todo set (OTB_DATA_ROOT "${OTB_SOURCE_DIR}/otb-data/") # todo
set (OTB_LARGEINPUT_ROOT "") # todo set (OTB_LARGEINPUT_ROOT "") # todo
message(STATUS "CI profile : $ENV{OTB_CI_PROFILE}") message(STATUS "CI profile : ${ci_profile}")
#The following file set the CONFIGURE_OPTIONS variable #The following file set the CONFIGURE_OPTIONS variable
set (CONFIGURE_OPTIONS "") set (CONFIGURE_OPTIONS "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment