-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
97 lines (91 loc) · 1.97 KB
/
.gitlab-ci.yml
File metadata and controls
97 lines (91 loc) · 1.97 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
91
92
93
94
95
96
97
---
variables:
JUNIT_TEST_REPORT: test_report_${CI_COMMIT_SHORT_SHA}.html
COVERAGE_TEST_REPORT: coverage_report_${CI_COMMIT_SHORT_SHA}
PYTHON_VERSION:
value: "3.10"
options:
- "3.10"
- "3.11"
- "3.12"
description: Python version to use
stages:
- validate
- test
- build
validate-yaml:
stage: validate
image: alpine
script:
- apk add yamllint
- cd $CI_PROJECT_DIR
- yamllint .
rules:
- changes:
- "*.yml"
- "*.yaml"
.python:
image:
name: python:${PYTHON_VERSION}-slim
pull_policy: if-not-present
before_script:
- pip install uv
allow_failure: false
Code-Check:
extends: .python
stage: validate
script:
- cd $CI_PROJECT_DIR
- uv run mypy --check .
- uv run ruff check .
rules:
- if: $CI_JOB_MANUAL
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- src/**/*.py
- tools/*.py
Check-HLA-Modified-Dates:
stage: validate
extends: .python
variables:
PYTHONPATH: "${CI_BUILDS_DIR}/src"
script:
- apt update
- apt install git-restore-mtime -y --no-install-recommends
- cd $CI_PROJECT_DIR
- uv run tools/check_date_modified.py check-dates
rules:
- if: $CI_JOB_MANUAL
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- src/**/*.csv
- src/**/*.mtime
Unit-Tests:
extends: .python
stage: test
script:
- cd $CI_PROJECT_DIR
- uv run pytest
-vra
--html=${JUNIT_TEST_REPORT}
--self-contained-html
--cov-report=html:${COVERAGE_TEST_REPORT}
--cov-report=term
--junitxml=pytest.xml
parallel:
matrix:
- PYTHON_VERSION:
- "3.10"
- "3.11"
- "3.12"
coverage: '/^TOTAL.+?(\d+\%)$/'
interruptible: true
artifacts:
reports:
junit: pytest.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- ${COVERAGE_TEST_REPORT}/*
- ${JUNIT_TEST_REPORT}