From 7f7933f93f6cdf35667b22905c29aa830a42df44 Mon Sep 17 00:00:00 2001 From: Carlos Pascual Date: Thu, 11 Mar 2021 14:54:16 +0000 Subject: [PATCH] Implement all CI in Gitlab - Use a matrix to test on py 3.6-3.9 - Add doc test and deployment - Add flake8 test --- .gitlab-ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6e34eb91..3c078fd0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,63 @@ -nodb: - stage: test - image: - name: registry.gitlab.com/taurus-org/taurus-docker:nodb - before_script: - - pip install -e . - script: - - pytest -n3 --forked -v lib/taurus +variables: + DEFAULT_PY_VERSION: "3.9" + + +doc: + # build docs + stage: test + image: + name: registry.gitlab.com/taurus-org/taurus-docker:nodb-$DEFAULT_PY_VERSION + variables: + PUBLIC_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public + before_script: + - pip install sphinx sphinx-rtd-theme + script: + - xvfb-run sphinx-build -qW doc/source/ public + artifacts: + paths: + - public + environment: + name: Docs-dev + url: "https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html" + + +tests: + # run test suite with various py versions + parallel: + matrix: + - PY_VERSION: ["3.6", "3.7", "3.8", "3.9"] + stage: test + image: + name: registry.gitlab.com/taurus-org/taurus-docker:nodb-$PY_VERSION + before_script: + - pip install -e . + script: + - pytest -n3 --forked -v lib/taurus + + +flake8: + # check style with flake8 + allow_failure: true + stage: test + image: + name: python:3.9-alpine + before_script: + - pip install flake8 + script: + - flake8 . + + +pages: + # deploy docs + stage: deploy + script: + - echo "deploying already-built docs " + artifacts: + paths: + - public + only: + variables: + - $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+.*$/ + +