-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (47 loc) · 1.04 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
stages:
- test
- package
variables:
PYTHONUNBUFFERED: "1"
PYTHONDONTWRITEBYTECODE: "1"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
test:tox:
stage: test
image: python:$PYTHON_VERSION
parallel:
matrix:
- PYTHON_VERSION:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
cache:
key: pip-$PYTHON_VERSION
paths:
- .cache/pip
script:
- python3 --version
- python3 -m pip install --upgrade pip wheel tox
- tox
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: dist/coverage.xml
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
package:pypi:
stage: package
image: python:3.11
only:
- tags
needs:
- "test:tox"
script:
- python3 --version
- python3 -m pip install --upgrade pip wheel build twine
- python3 -m build
- twine upload --non-interactive dist/*
# Set these envvars in [settings] > [ci/cd] > [variables]:
# - TWINE_USERNAME: __token__
# - TWINE_PASSWORD: pypi-...