From c039f498c75c7acaeb7aca25193c61f27088534c Mon Sep 17 00:00:00 2001
From: Amir Mohammadi <183.amir@gmail.com>
Date: Tue, 31 Jan 2017 17:18:14 +0100
Subject: [PATCH] add ci

---
 .gitlab-ci.yml | 249 +++++++++++++++++++++++++++++++++++++++++++++++++
 .travis.yml    |  33 -------
 2 files changed, 249 insertions(+), 33 deletions(-)
 create mode 100644 .gitlab-ci.yml
 delete mode 100644 .travis.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..fa11e07
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,249 @@
+# 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.
+
+
+# Definition of our build pipeline
+stages:
+  - build
+  - test
+  - docs
+  - wheels
+  - deploy
+
+
+# ---------
+# Templates
+# ---------
+
+# 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
+    - 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
+  script:
+    - ./_ci/build.sh
+  after_script:
+    - ./_ci/after_build.sh
+  artifacts:
+    expire_in: 1 week
+    paths:
+      - _ci/
+      - dist/
+      - sphinx/
+
+
+# Template for the test stage - re-installs from uploaded wheels
+# Needs to run on all supported architectures, platforms and python versions
+.test_template: &test_job
+  stage: test
+  before_script:
+    - ./_ci/install.sh _ci #updates
+    - ./_ci/before_test.sh
+  script:
+    - ./_ci/test.sh
+  after_script:
+    - ./_ci/after_test.sh
+
+
+# Template for the wheel uploading stage
+# Needs to run against one supported architecture, platform and python version
+.wheels_template: &wheels_job
+  stage: wheels
+  environment: intranet
+  only:
+    - master
+    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
+  before_script:
+    - ./_ci/install.sh _ci #updates
+    - ./_ci/before_wheels.sh
+  script:
+    - ./_ci/wheels.sh
+  after_script:
+    - ./_ci/after_wheels.sh
+
+
+# Template for (latest) documentation upload stage
+# Only one real job needs to do this
+.docs_template: &docs_job
+  stage: docs
+  environment: intranet
+  only:
+    - master
+  before_script:
+    - ./_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
+  script:
+    - ./_ci/deploy.sh
+  after_script:
+    - ./_ci/after_deploy.sh
+
+
+# -------------
+# Build Targets
+# -------------
+
+# Linux + Python 2.7: Builds, tests, uploads wheel and deploys (if needed)
+build_linux_27:
+  <<: *build_job
+  variables: &linux_27_build_variables
+    PYTHON_VERSION: "2.7"
+    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
+  variables: *linux_27_build_variables
+  dependencies:
+    - build_linux_27
+  tags:
+    - conda-linux
+
+deploy_linux_27:
+  <<: *deploy_job
+  variables: *linux_27_build_variables
+  dependencies:
+    - build_linux_27
+  tags:
+    - conda-linux
+
+
+# Linux + Python 3.4: Builds and tests
+build_linux_34:
+  <<: *build_job
+  variables: &linux_34_build_variables
+    PYTHON_VERSION: "3.4"
+    WHEEL_TAG: "py3"
+  tags:
+    - conda-linux
+
+test_linux_34:
+  <<: *test_job
+  variables: *linux_34_build_variables
+  dependencies:
+    - build_linux_34
+  tags:
+    - conda-linux
+
+
+# Linux + Python 3.5: Builds, tests and uploads wheel
+build_linux_35:
+  <<: *build_job
+  variables: &linux_35_build_variables
+    PYTHON_VERSION: "3.5"
+    WHEEL_TAG: "py3"
+  tags:
+    - conda-linux
+
+test_linux_35:
+  <<: *test_job
+  variables: *linux_35_build_variables
+  dependencies:
+    - build_linux_35
+  tags:
+    - conda-linux
+
+wheels_linux_35:
+  <<: *wheels_job
+  variables: *linux_35_build_variables
+  dependencies:
+    - build_linux_35
+  tags:
+    - conda-linux
+
+docs_linux_35:
+  <<: *docs_job
+  variables: *linux_35_build_variables
+  dependencies:
+    - build_linux_35
+  tags:
+    - conda-linux
+
+
+# Mac OSX + Python 2.7: Builds and tests
+build_macosx_27:
+  <<: *build_job
+  variables: &macosx_27_build_variables
+    PYTHON_VERSION: "2.7"
+    WHEEL_TAG: "py27"
+  tags:
+    - conda-macosx
+
+test_macosx_27:
+  <<: *test_job
+  variables: *macosx_27_build_variables
+  dependencies:
+    - build_macosx_27
+  tags:
+    - conda-macosx
+
+
+# Mac OSX + Python 3.4: Builds and tests
+build_macosx_34:
+  <<: *build_job
+  variables: &macosx_34_build_variables
+    PYTHON_VERSION: "3.4"
+    WHEEL_TAG: "py3"
+  tags:
+    - conda-macosx
+
+test_macosx_34:
+  <<: *test_job
+  variables: *macosx_34_build_variables
+  dependencies:
+    - build_macosx_34
+  tags:
+    - conda-macosx
+
+
+# Mac OSX + Python 3.5: Builds and tests
+build_macosx_35:
+  <<: *build_job
+  variables: &macosx_35_build_variables
+    PYTHON_VERSION: "3.5"
+    WHEEL_TAG: "py3"
+  tags:
+    - conda-macosx
+
+test_macosx_35:
+  <<: *test_job
+  variables: *macosx_35_build_variables
+  dependencies:
+    - build_macosx_35
+  tags:
+    - conda-macosx
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 0bdb952..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-language: python
-matrix:
-  include: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HnO5vrxkDRnzmao5PfaJGNWNnfGdtMnd1JqjDpio9dUFWUa4AJieocZ7GbhFS9ZLWS1xM8vlnttjETxww5zbqC/QL4+xeVMoW3Cq7yeTIE2ELjKc3K+zT2KMb1iusbtOBwB7KfINEjcoIsQnlxrve+4//GuBrZ+Uq+8IhzKj1GTErkEEWaxlNdgf0YJ5uOkKOFIylUPM4cAqXnqSNjcRhUKBd5G4xC5w4vNWCzl1Yn7T0gmK2pOLDh8Ygs1CkquLLZodtjWOmIAE2vgFCeigiNtrhD9eKTCfXH5fYFKXCgCUDgPhh2yrPWJWYc=
-    - BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master
-    - BOB_UPLOAD_WHEEL="--universal"
-  - python: 3.3
-  - python: 3.4
-  - python: 3.5
-before_install:
-- sudo add-apt-repository -y ppa:biometrics/bob
-- sudo apt-get update -qq
-- sudo apt-get install -qq --force-yes libjpeg8-dev libnetpbm10-dev libpng12-dev libtiff4-dev libgif-dev libboost-all-dev libblitz1-dev libhdf5-serial-dev libvl-dev dvipng texlive-latex-base texlive-latex-extra texlive-math-extra texlive-latex-recommended texlive-fonts-recommended libatlas-dev libatlas-base-dev liblapack-dev gfortran
-- pip install --upgrade pip
-- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel sphinx nose numpy scipy matplotlib coverage
-- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel --pre -r requirements.txt coveralls
-install:
-- python bootstrap-buildout.py
-- ./bin/buildout buildout:develop=. buildout:extensions=bob.buildout buildout:auto-checkout=
-script:
-- ./bin/python -c 'import pkg_resources; from bob.bio.base import get_config; print(get_config())'
-- ./bin/coverage run --source=bob.bio.base ./bin/nosetests -sv
-- ./bin/sphinx-build -b doctest doc sphinx
-- ./bin/sphinx-build -b html doc sphinx
-after_success:
-- coveralls
-- wget https://raw.githubusercontent.com/bioidiap/bob.extension/master/scripts/upload-{sphinx,wheel}.sh
-- chmod a+x upload-sphinx.sh upload-wheel.sh
-- ./upload-sphinx.sh
-- ./upload-wheel.sh
-- 
GitLab