-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
137 lines (126 loc) · 2.25 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PYTHON_VERSION: "3.10"
stages:
- quality
- test
- docs
- deploy
.base:
image: python:$PYTHON_VERSION
cache:
key:
files:
- pyproject.toml
prefix: $CI_JOB_NAME
paths:
- .cache/pip
- .tox
interruptible: true
before_script:
- pip install tox
quality:lint:
extends: .base
stage: quality
script:
- tox -e lint
test:unittest:
extends: .base
stage: test
image: python:$PYTHON_VER
script:
- tox -e $ENV
- tox -e coverage-report
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/cobertura.xml
parallel:
matrix:
- ENV: py39
PYTHON_VER: "3.9"
- ENV: py310
PYTHON_VER: "3.10"
- ENV: py311
PYTHON_VER: "3.11"
- ENV: py312
PYTHON_VER: "3.12"
- ENV: py313
PYTHON_VER: "3.13"
docs:docs:
extends: .base
stage: docs
script:
- tox -e docs
docs:changelog:
extends: .base
stage: docs
script:
- tox -e changelog
docs:description:
extends: .base
stage: docs
script:
- tox -e pypi-description
deploy:publish_docs:
extends: .base
stage: deploy
script:
- tox -e docs
- mv docs/_build/html html
# - mv docs/_build/rinoh pdf
artifacts:
name: "docs-$CI_COMMIT_REF_NAME"
paths:
- html
# - pdf/mlnext.pdf
only:
- main
- tags
deploy:build:
extends: .base
stage: deploy
artifacts:
name: dist
paths:
- ./dist
expire_in: 1h
script:
- tox -e build
only:
- main
- tags
deploy:release-private:
image: python:$PYTHON_VERSION
stage: deploy
needs:
- deploy:build
before_script:
- pip install twine
script:
- python -m twine upload --verbose --skip-existing dist/*
only:
- tags
deploy:release-public-pypi:
image: python:$PYTHON_VERSION
stage: deploy
needs:
- deploy:build
before_script:
- pip install twine
script:
- >
python
-m twine upload
--verbose
--skip-existing
--repository-url ${PYPI_REPOSITORY_URL}
--cert ${PYPI_CERT}
-u ${PYPI_USER}
-p ${PYPI_TOKEN}
dist/*
only:
- pypi-release
- tags
allow_failure: true