-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
51 lines (48 loc) · 1.52 KB
/
.gitlab-ci.yml
File metadata and controls
51 lines (48 loc) · 1.52 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
stages:
- test # Run tests
test-python:
stage: test
needs: [] # no dependencies to precious pipelines stages
tags:
- ito
image: python:3.12
script:
- pip install --no-cache-dir -r requirements-dev.txt
- poetry install --with dev --all-extras
- poetry run pytest --cov --cov-report term --cov-report xml:coverage.xml --junitxml=report.xml --log-cli-level=INFO
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts: # Collect test results
when: always
paths:
- report.xml
reports:
junit: report.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
test:format-lint:
stage: test
tags:
- ito
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.13
script:
- pip install --no-cache-dir pre-commit
- pre-commit run poetry-check
- pre-commit run poetry-lock
- pre-commit run black --all-files --show-diff-on-failure
- pre-commit run ruff --all-files --show-diff-on-failure
# mypy in extra codequality step
test:codequality:
stage: test
tags:
- ito
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.13
script:
- pip install -r requirements-dev.txt
- poetry install --with dev
- poetry run mypy . --no-error-summary > mypy-out.txt || true # "|| true" is used for preventing job fail when mypy find errors
- poetry run mypy-gitlab-code-quality < mypy-out.txt > codequality.json
artifacts:
when: always
reports:
codequality: codequality.json