.gitlab-ci.yml 2.27 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 8 9 10
# efficient cloning step.
# Furthermore, Git-LFS and Gitlab sufer a bug preventing usage of 
# 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/gbonnefille/otb-build-env
Sébastien Dinot's avatar
Sébastien Dinot committed
13
  DOCKER_DRIVER: overlay2
14
  GIT_DEPTH: "3"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
15
  # Disable automatic checkout to let us fetch LFS before
16
  GIT_CHECKOUT: "false"
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
17
  # The fetch strategy fails with LFS and GitLab
18
  GIT_STRATEGY: "clone"
19 20

before_script:
21 22
  # make sure LFS hooks are installed
  - git lfs install
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
23
  # Provision efficiently the local LFS cache before checkout
24
  - git lfs fetch origin $CI_COMMIT_SHA
Guilhem Bonnefille's avatar
Guilhem Bonnefille committed
25
  # Checkout the expected branch
26
  - git checkout $CI_COMMIT_REF_NAME
Sébastien Dinot's avatar
Sébastien Dinot committed
27

28
after_script:
Antoine Regimbeau's avatar
Antoine Regimbeau committed
29
  - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH
30

Sébastien Dinot's avatar
Sébastien Dinot committed
31
stages:
Guillaume Pasero's avatar
Guillaume Pasero committed
32
  - precheck
Sébastien Dinot's avatar
Sébastien Dinot committed
33 34
  - build

35
.general:
Sébastien Dinot's avatar
Sébastien Dinot committed
36 37 38 39 40 41
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure

Guillaume Pasero's avatar
Guillaume Pasero committed
42 43 44 45
fast-build:
  extends: .general
  only: [merge_requests, branches]
  stage: precheck
46 47 48
  image: $CI_REGISTRY/gpasero/otb/otb-install-ubuntu-native
  before_script:
    - git checkout $CI_COMMIT_REF_NAME
49
    - python3 CI/check_twin_pipelines.py
Guillaume Pasero's avatar
Guillaume Pasero committed
50 51
  script:
    - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
52
    - ccache -s
Guillaume Pasero's avatar
Guillaume Pasero committed
53

54 55
debian-build:
  extends: .general
56
  only: [merge_requests]
57
  stage: build
58
  image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
59
  script:
60
    - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
61

62
.common-build:
63
  extends: .general
Antoine Regimbeau's avatar
Antoine Regimbeau committed
64
  stage: build
65
  image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native:18.04
Antoine Regimbeau's avatar
Antoine Regimbeau committed
66
  script:
67
    - 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
68 69 70 71 72
  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
73 74

ubuntu-llvm:
75 76 77
  only: [merge_requests]
  extends: .common-build