-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
128 lines (118 loc) · 3.03 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
default:
image: python:3.13
before_script:
- uname -a
- python -V # Print out python version for debugging
- apt-get update
- git config --global user.email "[email protected]"
- git config --global user.name "CoBib"
- pip install virtualenv tox
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
TERM: "linux"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
stages:
- test
- deploy
lint:
stage: test
script:
- tox -e lint
- head -1 cobertura.xml | awk -F'line-rate*=*\"' '{sub(/".*/,"",$2); printf "mypy coverage %.0f", $2 * 100; print "%"}'
coverage: '/mypy coverage \d+%/'
artifacts:
when: always
expire_in: 30 days
paths:
- cobertura.xml
- htmlmypy
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml
test:
stage: test
parallel:
matrix:
- PYTHON_VERSION: ['3.9', '3.10', '3.11', '3.12', '3.13']
image: python:$PYTHON_VERSION
script:
- tox -e py$PYTHON_VERSION
artifacts:
when: always
expire_in: 30 days
paths:
- tests/report-py$PYTHON_VERSION.xml
reports:
junit: tests/report-py$PYTHON_VERSION.xml
no-optionals:
stage: test
script:
- tox -e no-optionals
artifacts:
when: always
expire_in: 30 days
paths:
- tests/report-no-optionals.xml
reports:
junit: tests/report-no-optinals.xml
plugin:
stage: test
script:
- tox -e plugin
artifacts:
when: always
expire_in: 30 days
paths:
- plugin/tests/report-plugin.xml
reports:
junit: plugin/tests/report-plugin.xml
coverage:
stage: test
script:
- tox -e coverage
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+\s+\d+\s+)*(\d+%)/'
artifacts:
when: always
expire_in: 30 days
paths:
- coverage.xml
- htmlcov
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml
develop:
stage: deploy
environment:
name: dev
url: "https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
script:
- tox -e docs
- mv docs public
artifacts:
paths:
- public
variables:
PUBLIC_URL: "/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public"
pages:
stage: deploy
script:
- tox -e docs
- mv docs public
artifacts:
paths:
- public
when: manual
only:
- master
- tags