-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (46 loc) · 990 Bytes
/
.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
# jobs in the same stage run in parallel
# later stages run after all jobs of previous stage were successfull
stages:
- static-checks
- test
- deploy
flake8:
stage: static-checks
image: "python:3.8"
before_script:
- python --version
- pip install flake8
script:
- flake8 src/
tests:
stage: test
before_script:
- python --version
- pip install .[test]
script:
- pytest -v
variables:
PYTEST_ADDOPTS: --color=yes
parallel:
matrix:
- PYTHON_VERSION:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
image: "python:$PYTHON_VERSION"
# need to set the TWINE_PASSWORD env variable
# in the gitlab ci secrets
pypi:
image: "python:3.8"
stage: deploy
script:
- pip install -U twine build
- python -m build
- twine upload dist/*
only:
- tags
variables:
TWINE_NON_INTERACTIVE: "true"
TWINE_USERNAME: "__token__"
TWINE_REPOSITORY: "testpypi" # remove to upload to actual pypi