.gitlab-ci.yml 5.06 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
  BUILD_IMAGE_REGISTRY: $CI_REGISTRY/orfeotoolbox/otb-build-env
13
  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

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

Guillaume Pasero's avatar
Guillaume Pasero committed
47

Guillaume Pasero's avatar
Guillaume Pasero committed
48
.common-build:
49 50 51
  extends: .general
  only: [merge_requests]
  stage: build
52
  before_script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
53
    - git lfs install --skip-repo
54 55 56 57 58
    # 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:
59
    - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH $CI_MERGE_REQUEST_REF_PATH
Antoine Regimbeau's avatar
Antoine Regimbeau committed
60 61 62 63
  artifacts:
    when: on_failure
    expire_in: 24 hrs
    paths:
64
      - log/*.txt
Antoine Regimbeau's avatar
Antoine Regimbeau committed
65
      - build/*/*.log
Guillaume Pasero's avatar
Guillaume Pasero committed
66 67 68

debian-build:
  extends: .common-build
69 70 71
  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
72

Guillaume Pasero's avatar
Guillaume Pasero committed
73 74
ubuntu-llvm:
  extends: .common-build
75
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
Antoine Regimbeau's avatar
Antoine Regimbeau committed
76
  script:
77
    - 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
78 79 80 81 82
  artifacts:
    paths:
      - build/CookBook-*-html.tar.gz
      - build/Documentation/Cookbook/latex/CookBook-*.pdf
      - build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2
aregimbe's avatar
aregimbe committed
83

84
.common-prepare:
aregimbe's avatar
aregimbe committed
85
  extends: .general
Guillaume Pasero's avatar
Guillaume Pasero committed
86
  only: [merge_requests]
aregimbe's avatar
aregimbe committed
87 88
  stage: prepare
  before_script:
89
    - git checkout -f -q $CI_COMMIT_SHA
Antoine Regimbeau's avatar
Antoine Regimbeau committed
90
    - git lfs install --skip-repo
Antoine Regimbeau's avatar
Antoine Regimbeau committed
91 92
    - git config --global user.email "otbbot@orfeo-toolbox.org"
    - git config --global user.name "otbbot"
aregimbe's avatar
aregimbe committed
93 94
  artifacts:
    expire_in: 24 hrs
Antoine Regimbeau's avatar
Antoine Regimbeau committed
95
    when: always
aregimbe's avatar
aregimbe committed
96
    paths:
97
      - sb_branch.txt
aregimbe's avatar
aregimbe committed
98 99 100
      # This recovers logs from superbuild build
      - build/*/*/*/*.log

101
## Ubuntu superbuild
102 103 104 105
ubuntu-superbuild-prepare:
  extends: .common-prepare
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  script:
106
    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
107

108 109 110 111
ubuntu-superbuild-build:
  extends: .common-build
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
  script:
112
    - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
113
    - 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
114 115
  dependencies:
    - ubuntu-superbuild-prepare
116

Antoine Regimbeau's avatar
Antoine Regimbeau committed
117
## CentOS superbuild
118 119 120 121 122 123
centos-superbuild-prepare:
  extends: .common-prepare
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base

124
centos-superbuild-build:
Guillaume Pasero's avatar
Guillaume Pasero committed
125
  extends: .common-build
126 127
  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
  script:
128
    - 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
  dependencies:
131
    - centos-superbuild-prepare
Cédric Traizet's avatar
Cédric Traizet committed
132

Antoine Regimbeau's avatar
Antoine Regimbeau committed
133
## MacOS superbuild
Cédric Traizet's avatar
Cédric Traizet committed
134 135 136 137 138
macos-superbuild-prepare:
  tags:
    - macos
  only: [merge_requests, branches]
  extends: .common-prepare
139
  before_script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
140
    # No need to install lfs as this machine is persistent
Antoine Regimbeau's avatar
Antoine Regimbeau committed
141
    # No need to do git config
142 143
    # Checkout the expected branch
    - git checkout -f -q $CI_COMMIT_SHA
Cédric Traizet's avatar
Cédric Traizet committed
144 145 146 147 148 149
  script:
    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild

macos-superbuild-build:
  tags:
    - macos
150
  extends: .common-build
Antoine Regimbeau's avatar
Antoine Regimbeau committed
151
  only: [merge_requests, branches]
Cédric Traizet's avatar
Cédric Traizet committed
152
  script:
153
    - ctest -VV -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
Antoine Regimbeau's avatar
Antoine Regimbeau committed
154
    - ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
Cédric Traizet's avatar
Cédric Traizet committed
155 156
  dependencies:
    - macos-superbuild-prepare