Skip to content

Commit

Permalink
Implement all CI in Gitlab
Browse files Browse the repository at this point in the history
- Use a matrix to test on py 3.6-3.9
- Add doc test and deployment
- Add flake8 test
  • Loading branch information
Carlos Pascual committed Mar 17, 2021
1 parent 4ab2708 commit 7f7933f
Showing 1 changed file with 62 additions and 8 deletions.
70 changes: 62 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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]+.*$/



0 comments on commit 7f7933f

Please sign in to comment.