.gitlab-ci.yml 3.41 KB
Newer Older
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
1 2 3
# This build file heavily uses template features from YAML so it is generic
# enough for any Bob project. Don't modify it unless you know what you're
# doing.
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
4 5 6 7 8 9 10 11


# Definition of our build pipeline
stages:
  - build
  - test
  - docs
  - wheels
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
12
  - deploy
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
13 14


Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
15 16 17
# ---------
# Templates
# ---------
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
18 19 20 21 22 23 24

# Template for the build stage
# Needs to run on all supported architectures, platforms and python versions
.build_template: &build_job
  stage: build
  before_script:
    - git clean -ffdx
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
25 26 27 28 29
    - mkdir _ci
    - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
    - chmod 755 _ci/install.sh
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_build.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
30
  script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
31
    - ./_ci/build.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
32
  after_script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
33
    - ./_ci/after_build.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
34
  artifacts:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
35
    expire_in: 1 week
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
36
    paths:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
37
      - _ci/
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
38 39 40 41
      - dist/
      - sphinx/


Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
42
# Template for the test stage - re-installs from uploaded wheels
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
43 44 45 46
# Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job
  stage: test
  before_script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
47 48
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_test.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
49
  script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
50
    - ./_ci/test.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
51
  after_script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
52
    - ./_ci/after_test.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
53 54 55


# Template for the wheel uploading stage
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
56
# Needs to run against one supported architecture, platform and python version
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
57 58
.wheels_template: &wheels_job
  stage: wheels
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
59
  environment: intranet
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
60 61
  only:
    - master
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
62
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
63
  before_script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
64 65
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_wheels.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
66
  script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
67 68 69
    - ./_ci/wheels.sh
  after_script:
    - ./_ci/after_wheels.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
70 71 72 73 74 75


# Template for (latest) documentation upload stage
# Only one real job needs to do this
.docs_template: &docs_job
  stage: docs
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
76
  environment: intranet
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
77 78 79
  only:
    - master
  before_script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_docs.sh
  script:
    - ./_ci/docs.sh
  after_script:
    - ./_ci/after_docs.sh


# Template for the deployment stage - re-installs from uploaded wheels
# Needs to run on a single architecture only
# Will deploy your package to PyPI and other required services
# Only runs for tags
.deploy_template: &deploy_job
  stage: deploy
  environment: internet
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_deploy.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
102
  script:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
103 104 105
    - ./_ci/deploy.sh
  after_script:
    - ./_ci/after_deploy.sh
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
106 107


Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
108 109 110
# -------------
# Build Targets
# -------------
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
111 112


113 114
# Linux + Python 3.6: Builds, tests and uploads wheel
build_linux_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
115
  <<: *build_job
116 117
  variables: &linux_36_build_variables
    PYTHON_VERSION: "3.6"
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
118 119 120 121
    WHEEL_TAG: "py3"
  tags:
    - conda-linux

122
test_linux_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
123
  <<: *test_job
124
  variables: *linux_36_build_variables
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
125
  dependencies:
126
    - build_linux_36
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
127 128 129
  tags:
    - conda-linux

130
wheels_linux_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
131
  <<: *wheels_job
132
  variables: *linux_36_build_variables
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
133
  dependencies:
134
    - build_linux_36
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
135 136 137
  tags:
    - conda-linux

138
docs_linux_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
139
  <<: *docs_job
140
  variables: *linux_36_build_variables
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
141
  dependencies:
142
    - build_linux_36
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
143 144 145 146
  tags:
    - conda-linux


147 148
# Mac OSX + Python 3.6: Builds and tests
build_macosx_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
149
  <<: *build_job
150 151
  variables: &macosx_36_build_variables
    PYTHON_VERSION: "3.6"
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
152 153 154 155
    WHEEL_TAG: "py3"
  tags:
    - conda-macosx

156
test_macosx_36:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
157
  <<: *test_job
158
  variables: *macosx_36_build_variables
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
159
  dependencies:
160
    - build_macosx_36
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
161
  tags:
Pavel KORSHUNOV's avatar
Pavel KORSHUNOV committed
162
    - conda-macosx