-
Notifications
You must be signed in to change notification settings - Fork 15
/
.gitlab-ci.yml
82 lines (77 loc) · 1.54 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
stages:
- test
- report
variables:
PIP_CACHE_DIR: .cache/pip
PRE_COMMIT_HOME: .cache/pre-commit
TOX_TESTENV_PASSENV: PIP_CACHE_DIR
.pipcache:
cache:
key: pip
paths:
- $PIP_CACHE_DIR
pytest:
extends: .pipcache
stage: test
image: python:$PYTHON_VERSION
variables:
TOXENV: $TOXENV
before_script:
- pip install -U pip setuptools wheel
- pip install -U virtualenv tox
script:
- tox -- -v --junitxml=junit.xml
artifacts:
when: always
paths:
- .coverage.*
reports:
junit: junit.xml
parallel:
matrix:
- PYTHON_VERSION: "3.7"
TOXENV: py37
- PYTHON_VERSION: "3.8"
TOXENV: py38
- PYTHON_VERSION: "3.9"
TOXENV: py39
- PYTHON_VERSION: "3.10"
TOXENV: py310
- PYTHON_VERSION: "3.11"
TOXENV: py311
pre-commit:
stage: test
image: python:3.11
before_script:
- pip install pre-commit
script:
- pre-commit run --all-files
cache:
key: pre-commit
paths:
- $PIP_CACHE_DIR
- $PRE_COMMIT_HOME
coverage:
extends: .pipcache
stage: report
image: python:3.11
before_script:
- pip install -U pip setuptools wheel
- pip install -U coverage[toml]
script:
- coverage combine
- coverage report
- coverage html
- coverage xml
when: always
artifacts:
name: coverage-${CI_COMMIT_SHORT_SHA}
expose_as: Coverage Report
paths:
- htmlcov
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
needs:
- pytest