From e1b6d0e1a3b67004e31d041265cdf9556e2e39b7 Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Sun, 20 Nov 2016 21:11:00 +0100
Subject: [PATCH] Testing ci

---
 .gitlab-ci.yml    | 42 ++++++++++++++++++++++++++++++++++++++++++
 ci/before_test.sh |  5 ++++-
 ci/test.sh        |  2 --
 3 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aab83f9..e941c20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,8 @@
 # Definition of our build pipeline
 stages:
   - buildbob
+  - testbob
+  - wheelsbob
 
 # ---------
 # Templates
@@ -28,6 +30,29 @@ stages:
       - dist/
 
 
+# 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: testbob
+  before_script:
+    - ./ci/before_test.sh 1 buildout-bob.cfg
+  script:
+    - ./ci/test.sh
+  after_script:
+    - ./ci/after_test.sh
+    
+
+# Template for the wheel uploading stage
+# Needs to run against all combinations of python and operating systems
+.wheels_template: &wheels_job
+  stage: wheels
+  environment: intranet
+  only:
+    - new_ci
+    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
+  script:
+    - ./wheels_dependencies.sh
+
 # -------------
 # Build Targets
 # -------------
@@ -39,3 +64,20 @@ build_linux_27:
     PYTHON_VERSION: "2.7"
   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
+
diff --git a/ci/before_test.sh b/ci/before_test.sh
index 3709c10..15e1642 100755
--- a/ci/before_test.sh
+++ b/ci/before_test.sh
@@ -3,7 +3,10 @@
 
 source $(dirname ${0})/functions.sh
 
-run_cmd $(dirname ${0})/before_build.sh
+PIPINSTALL=$1
+CONFIG_FILE=$2
+
+run_cmd $(dirname ${0})/before_build.sh ${PIPINSTALL} ${CONFIG_FILE}
 
 # Source the newly created virtualenv
 log_info "$ source ${PREFIX}/bin/activate"
diff --git a/ci/test.sh b/ci/test.sh
index 85ac251..7dbb780 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -7,7 +7,5 @@ run_cmd cd ${PREFIX}
 
 # The tests:
 run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage run --source=${CI_PROJECT_NAME} ${BOB_PREFIX_PATH}/bin/nosetests -sv ${CI_PROJECT_NAME}
-run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/coverage report
-run_cmd ${PREFIX}/bin/python ${BOB_PREFIX_PATH}/bin/sphinx-build -b doctest ${CI_PROJECT_DIR}/doc ${CI_PROJECT_NAME}/sphinx
 
 run_cmd cd ${CI_PROJECT_DIR}
-- 
GitLab