diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aab83f95c02bafa08e1d1b2b81dc0728a2b19963..e941c20715122cf0d8d69ec1b9d0d78303ef2a21 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 3709c10f2ba1b13c92d1b24b23a642033dac1a8c..15e164202b96df450a0d190e123096e391101797 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 85ac251a22e2d266cfd12bc0d394d4b91c7051d3..7dbb7807ab5c71e56f0f2a6d942d1982ecaa21d9 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}