forked from taurus-org/taurus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (100 loc) · 2.7 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
stages:
- build
- test
- deploy
build-pypi-package:
stage: build
image: python:3.9-slim-bullseye
needs: []
before_script:
- pip install --upgrade pip
- pip install --upgrade build
script:
- python -m build
artifacts:
expire_in: 1 day
paths:
- dist/
doc:
# build docs
stage: build
image: registry.gitlab.com/taurus-org/taurus-docker:conda-3.9
needs: []
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"
flake8_and_black:
# check style with flake8
stage: test
image: python:3.9-slim-bullseye
needs: []
before_script:
- pip install flake8==3.9.2 black==22.3.0
script:
# check with flake8
- flake8 .
# check with black
- black --check --diff .
tests:
# run test suite with various py versions
parallel:
matrix:
- TAURUS_TAG: ["bullseye", "buster", "stretch"]
# disable bullseye pyside2 tests until they are green
# QT_API: ["pyqt5", "pyside2"]
QT_API: ["pyqt5"]
- TAURUS_TAG: ["conda-3.9"]
QT_API: ["pyqt5", "pyside2"]
- TAURUS_TAG: ["conda-3.6", "conda-3.7", "conda-3.8"]
QT_API: ["pyqt5"]
stage: test
needs: ["build-pypi-package"]
variables:
GIT_STRATEGY: none
PYTEST_QT_API: $QT_API
image:
name: registry.gitlab.com/taurus-org/taurus-docker:$TAURUS_TAG
before_script:
- python3 -m pip install dist/taurus-*.whl
script:
- INST_DIR=$(python3 -c 'import taurus; print(taurus.__file__.rsplit("/",1)[0])')
- python3 -m pytest --junitxml=report.xml -n3 --forked -v $INST_DIR
artifacts:
when: always
reports:
junit: report.xml
pages:
# deploy docs
stage: deploy
image: alpine
variables:
GIT_STRATEGY: none
script:
- echo "Deploying already-built docs"
artifacts:
paths:
- public
only:
variables:
- $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+.*$/
deploy_to_pypi:
stage: deploy
image: python:3.9-slim-bullseye
variables:
GIT_STRATEGY: none
before_script:
- pip install twine
script:
- twine upload dist/*
only:
variables:
- $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+.*$/