.gitlab-ci.yml 3.66 KB
Newer Older
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira 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.
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
4 5 6 7 8 9 10 11


# Definition of our build pipeline
stages:
  - build
  - test
  - docs
  - wheels
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
12
  - deploy
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
13 14


Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
15 16 17
# ---------
# Templates
# ---------
Amir MOHAMMADI's avatar
Amir MOHAMMADI 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
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira 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
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
30
  script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
31 32 33 34 35 36 37 38 39
    - which python
    - python bootstrap-buildout.py    
    #- ./bin/buildout -c buildout-before-patch.cfg
    #- wget https://www.idiap.ch/software/bob/databases/latest/PythonFaceEvaluation.tar.bz2
    #- mkdir PythonFaceEvaluation
    #- tar -xjf PythonFaceEvaluation.tar.bz2 -C PythonFaceEvaluation
    #- ./bin/patch_CSU.py PythonFaceEvaluation
    #- ./bin/buildout buildout:csu-dir=PythonFaceEvaluation
    #- ./bin/python setup.py bdist_wheel
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
40
  after_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
41
    - ./_ci/after_build.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
42
  artifacts:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
43
    expire_in: 1 week
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
44
    paths:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
45
      - _ci/
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
46 47 48 49
      - dist/
      - sphinx/


Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
50
# Template for the test stage - re-installs from uploaded wheels
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
51 52 53 54
# Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job
  stage: test
  before_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
55 56
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_test.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
57
  script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
58
    - ./_ci/test.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
59
  after_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
60
    - ./_ci/after_test.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
61 62 63


# Template for the wheel uploading stage
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
64
# Needs to run against one supported architecture, platform and python version
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
65 66
.wheels_template: &wheels_job
  stage: wheels
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
67
  environment: intranet
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
68 69
  only:
    - master
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
70
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
71
  before_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
72 73
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_wheels.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
74
  script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
75 76 77
    - ./_ci/wheels.sh
  after_script:
    - ./_ci/after_wheels.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
78 79 80 81 82 83


# Template for (latest) documentation upload stage
# Only one real job needs to do this
.docs_template: &docs_job
  stage: docs
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
84
  environment: intranet
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
85 86 87
  only:
    - master
  before_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    - ./_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
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
110
  script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
111 112 113
    - ./_ci/deploy.sh
  after_script:
    - ./_ci/after_deploy.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
114 115


Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
116 117 118
# -------------
# Build Targets
# -------------
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
119

Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
120
# Linux + Python 2.7: Builds, tests, uploads wheel and deploys (if needed)
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
121
build_linux_27:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
122
  <<: *build_job
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
123
  variables: &linux_27_build_variables
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
124
    PYTHON_VERSION: "2.7"
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138
    WHEEL_TAG: "py27"
  tags:
    - conda-linux

test_linux_27:
  <<: *test_job
  variables: *linux_27_build_variables
  dependencies:
    - build_linux_27
  tags:
    - conda-linux

wheels_linux_27:
  <<: *wheels_job
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
139
  variables: *linux_27_build_variables
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
140 141 142 143 144
  dependencies:
    - build_linux_27
  tags:
    - conda-linux

Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
145 146 147
deploy_linux_27:
  <<: *deploy_job
  variables: *linux_27_build_variables
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
148
  dependencies:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
149
    - build_linux_27
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
150 151 152
  tags:
    - conda-linux

Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
153
docs_linux_27:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
154
  <<: *docs_job
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
155
  variables: *linux_27_build_variables
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
156
  dependencies:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
157
    - build_linux_27
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
158 159 160
  tags:
    - conda-linux