.gitlab-ci.yml 6.69 KB
Newer Older
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
1 2 3 4 5
# WARNING!
# OTB uses Git-LFS to store the (large) tests data.
# Git-LFS is mostly transparent for the user and recent versions
# are able to use Git-LFS quite efficiently.
# But Git fails to manage efficiently numerous LFS data.
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
6
# We have to use directly git-lfs wrapping commands to have an
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
7
# efficient cloning step.
8
# Furthermore, Git-LFS and Gitlab sufer a bug preventing usage of
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
9 10
# GIT_STRATEGY=fetch (https://gitlab.com/gitlab-org/gitlab-runner/issues/3318)

Sébastien Dinot's avatar
Sébastien Dinot committed
11
variables:
12 13
  BUILD_IMAGE_REGISTRY: $CI_REGISTRY/orfeotoolbox/otb-build-env
  GIT_CLONE_PATH: $CI_BUILDS_DIR/otb
Sébastien Dinot's avatar
Sébastien Dinot committed
14
  DOCKER_DRIVER: overlay2
15
  GIT_DEPTH: "3"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
16
  # Disable automatic checkout to let us fetch LFS before
17
  GIT_CHECKOUT: "false"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
18
  # The fetch strategy fails with LFS and GitLab
19
  GIT_STRATEGY: "clone"
20

Sébastien Dinot's avatar
Sébastien Dinot committed
21
stages:
Guillaume Pasero's avatar
Guillaume Pasero committed
22
  - precheck
aregimbe's avatar
aregimbe committed
23
  - prepare
Sébastien Dinot's avatar
Sébastien Dinot committed
24 25
  - build

26
.general:
Sébastien Dinot's avatar
Sébastien Dinot committed
27 28 29 30 31 32
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure

33 34 35 36
#~ fast-build:
  #~ extends: .general
  #~ only: [merge_requests, branches]
  #~ stage: precheck
37
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
38 39
  #~ before_script:
    #~ - export GIT_LFS_SKIP_SMUDGE=1
40
    #~ - git checkout -f -q $CI_COMMIT_SHA
41
    #~ - python3 CI/check_twin_pipelines.py
42 43
  #~ after_script:
    #~ - python3 CI/cdash_handler.py
44 45 46
  #~ script:
    #~ - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
    #~ - ccache -s
47

Guillaume Pasero's avatar
Guillaume Pasero committed
48

49 50
.common-build:
  extends: .general
51 52 53 54
  only:
    - merge_requests
    - develop
    - /^release-[0-9]+\.[0-9]+$/
55
  stage: build
56
  before_script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
57
    - git lfs install --skip-repo
58 59 60 61 62
    # Provision efficiently the local LFS cache before checkout
    - git lfs fetch origin $CI_COMMIT_SHA
    # Checkout the expected branch
    - git checkout -f -q $CI_COMMIT_SHA
  after_script:
63
    - python3 CI/cdash_handler.py
Antoine Regimbeau's avatar
Antoine Regimbeau committed
64 65 66 67
  artifacts:
    when: on_failure
    expire_in: 24 hrs
    paths:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
68 69
      - build/*/*.log #CMake log
      - log/*.txt # Others
70

71 72 73 74 75
#~ debian-build:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
Antoine Regimbeau's avatar
Antoine Regimbeau committed
76

77
.common-prepare:
aregimbe's avatar
aregimbe committed
78
  extends: .general
79 80 81 82
  only:
    - merge_requests
    - develop
    - /^release-[0-9]+\.[0-9]+$/
aregimbe's avatar
aregimbe committed
83 84
  stage: prepare
  before_script:
85
    - git checkout -f -q $CI_COMMIT_SHA
Antoine Regimbeau's avatar
Antoine Regimbeau committed
86
    - git lfs install --skip-repo
Antoine Regimbeau's avatar
Antoine Regimbeau committed
87 88
    - git config --global user.email "otbbot@orfeo-toolbox.org"
    - git config --global user.name "otbbot"
aregimbe's avatar
aregimbe committed
89 90
  artifacts:
    expire_in: 24 hrs
Antoine Regimbeau's avatar
Antoine Regimbeau committed
91
    when: always
aregimbe's avatar
aregimbe committed
92
    paths:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
93 94
      - sb_branch.txt # Needed to checkout correct branch in build step
      - build/*/*/*/*.log # Superbuild log
aregimbe's avatar
aregimbe committed
95

96
## Ubuntu superbuild
97 98 99 100 101
#~ ubuntu-superbuild-prepare:
  #~ extends: .common-prepare
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  #~ script:
    #~ - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
102
#~ 
103
#~ ubuntu-superbuild-build:
104
  #~ extends: .common-build
105
  #~ image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
106
  #~ script:
107 108 109 110
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-xdk
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
  #~ dependencies:
    #~ - ubuntu-superbuild-prepare
111 112 113 114 115
  #~ artifacts:
    #~ paths:
      #~ - build/CookBook-*-html.tar.gz
      #~ - build/Documentation/Cookbook/latex/CookBook-*.pdf
      #~ - build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
116

117
## CentOS superbuild
118 119 120 121
#~ centos-superbuild-prepare:
  #~ extends: .common-prepare
  #~ image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  #~ script:
122
    #~ - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
123 124 125 126 127 128
#~ 
#~ centos-superbuild-build:
  #~ extends: .common-build
  #~ image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  #~ script:
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
129
    #~ - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
130 131
  #~ dependencies:
    #~ - centos-superbuild-prepare
Guillaume Pasero's avatar
Guillaume Pasero committed
132

133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
## MacOS superbuild
#~ macos-superbuild-prepare:
  #~ tags:
    #~ - macos
  #~ extends: .common-prepare
  #~ before_script:
    #~ # No need to install lfs as this machine is persistent
    #~ # No need to do git config
    #~ # Checkout the expected branch
    #~ - export GIT_LFS_SKIP_SMUDGE=1
    #~ - git checkout -f -q $CI_COMMIT_SHA
    #~ - export GIT_LFS_SKIP_SMUDGE=0
  #~ script:
    #~ - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
#~ 
#~ macos-superbuild-build:
  #~ tags:
    #~ - macos
  #~ extends: .common-build
  #~ script:
    #~ - ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
    #~ - ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
  #~ dependencies:
    #~ - macos-superbuild-prepare

Guillaume Pasero's avatar
Guillaume Pasero committed
158
## Windows
159
.windows-prepare:
160
  extends: .general
161
  # only: [merge_requests]
aregimbe's avatar
aregimbe committed
162 163 164
  stage: prepare
  before_script:
# This override the previous before_script
165
    - set GIT_LFS_SKIP_SMUDGE=1
166
    - git checkout %CI_COMMIT_REF_NAME%
167
    - set GIT_LFS_SKIP_SMUDGE=0
aregimbe's avatar
aregimbe committed
168 169
  artifacts:
    expire_in: 24 hrs
170
    when: always
aregimbe's avatar
aregimbe committed
171
    paths:
172 173
      - sb_branch.txt # Needed to checkout correct branch in build step
      - build/*/*/*/*.log # Superbuild log
174

Guillaume Pasero's avatar
Guillaume Pasero committed
175 176 177 178 179 180 181
.common-windows-build:
  extends: .common-build
  before_script:
    - git lfs fetch origin %CI_COMMIT_SHA%
    - git checkout %CI_COMMIT_REF_NAME%
  after_script:
    - python ./CI/cdash_handler.py
182

Guillaume Pasero's avatar
Guillaume Pasero committed
183
# - Win10
184 185
windows-10-prepare:
  extends: .windows-prepare
186 187
  tags:
    - windows10
188
  script:
Guillaume Pasero's avatar
Guillaume Pasero committed
189
    - call ./CI/dev_env.bat x64 xdk 10
190 191 192 193
    - clcache.exe -s
    - ctest -C Release -V -S CI/prepare_superbuild.cmake
    - clcache.exe -s

194 195
windows-10-build:
  extends: .common-windows-build
Guillaume Pasero's avatar
Guillaume Pasero committed
196
  tags:
197
    - windows10
Guillaume Pasero's avatar
Guillaume Pasero committed
198 199 200 201 202
  script:
    - call ./CI/dev_env.bat x64 otb 10
    - clcache.exe -s
    - ctest -V -S CI/main_superbuild.cmake
    - clcache.exe -s
Guillaume Pasero's avatar
Guillaume Pasero committed
203
    - ctest -V -S CI/main_packages.cmake
Guillaume Pasero's avatar
Guillaume Pasero committed
204 205 206
  dependencies:
    - windows-10-prepare

Guillaume Pasero's avatar
Guillaume Pasero committed
207 208 209 210 211 212 213 214 215 216 217
# - Win8.1
windows-8-prepare:
  extends: .windows-prepare
  tags:
    - windows8
  script:
    - call ./CI/dev_env.bat x86 xdk 8.1
    - clcache.exe -s
    - ctest -C Release -V -S CI/prepare_superbuild.cmake
    - clcache.exe -s

Guillaume Pasero's avatar
Guillaume Pasero committed
218
windows-8-build:
219
  extends: .common-windows-build
Guillaume Pasero's avatar
Guillaume Pasero committed
220
  tags:
221
    - windows8
Guillaume Pasero's avatar
Guillaume Pasero committed
222
  script:
Guillaume Pasero's avatar
Guillaume Pasero committed
223
    - call ./CI/dev_env.bat x86 otb 8.1
Guillaume Pasero's avatar
Guillaume Pasero committed
224 225 226
    - clcache.exe -s
    - ctest -V -S CI/main_superbuild.cmake
    - clcache.exe -s
Guillaume Pasero's avatar
Guillaume Pasero committed
227
    - ctest -V -S CI/main_packages.cmake
Guillaume Pasero's avatar
Guillaume Pasero committed
228 229
  dependencies:
    - windows-8-prepare
230