-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
90 lines (81 loc) · 1.63 KB
/
.gitlab-ci.yml
File metadata and controls
90 lines (81 loc) · 1.63 KB
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
workflow:
rules:
- if: $CI_MERGE_REQUEST_ID # Execute jobs in merge request context
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "web" # manual run via GitLab UI
stages:
- build
- lint
- test
.python-cache: &python-cache
cache:
key: "${CI_JOB_NAME}"
paths:
- .venv/
- .cache/pip
- .cache/pypoetry
.python-job-template: &python-job-template
image: docker.io/library/python:${PYTHON_VERSION}
before_script:
- python --version
- pip install poetry
- poetry --version
- poetry models virtualenvs.in-project true
- poetry install -v
<<: *python-cache
variables:
PROJECT: src
parallel:
matrix:
- PYTHON_VERSION: ["3.8"]
isort:
<<: *python-job-template
stage: build
needs: []
script:
- poetry run isort **/*.py -c -v --profile black
black:
<<: *python-job-template
stage: build
needs: []
script:
- poetry run black --check .
mypy:
<<: *python-job-template
stage: lint
script:
- poetry run mypy $PROJECT tests
pylint:
<<: *python-job-template
stage: lint
script:
- poetry run pylint $PROJECT
needs:
- isort
- black
ruff:
<<: *python-job-template
stage: lint
script:
- poetry run ruff .
needs:
- isort
- black
unit-test:
<<: *python-job-template
stage: test
needs:
- isort
- black
script:
- make test
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: report.xml
paths:
- cov_html