-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
156 lines (142 loc) · 3.75 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
156 lines (142 loc) · 3.75 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
stages:
- style_check
- test
- deploy
default:
image: python:3.13
before_script:
- pip install poetry
- poetry config virtualenvs.in-project true
- poetry install --with tests
- source .venv/bin/activate
.run-test-with-coverage: &run-test-with-coverage
- apt-get update && apt-get install -y ffmpeg
- coverage run --source ./commonroad tests/run_tests.py
- coverage report -m || true
pre_commit:
stage: style_check
before_script:
- pip install pre-commit
script:
- pre-commit run --all-files --show-diff-on-failure
build_and_test_python:
image : python:$PYTHON_VERSIONS
stage: test
parallel :
matrix :
- PYTHON_VERSIONS : [ "3.9", "3.10", "3.11", "3.12" ]
script:
- *run-test-with-coverage
needs: []
build_and_test_python_arm:
image : arm64v8/python:$PYTHON_VERSIONS
tags :
- arm
stage: test
parallel :
matrix :
- PYTHON_VERSIONS : [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
script:
- *run-test-with-coverage
needs: []
build_and_test_python_3_13:
image: python:3.13
stage: test
script:
- *run-test-with-coverage
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
build_and_update_packages_arm:
image : arm64v8/python:$PYTHON_VERSIONS
tags :
- arm
stage: test
parallel :
matrix :
- PYTHON_VERSIONS : [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
script:
- poetry update
- poetry install
needs: []
build_and_update_packages_debian:
image : python:$PYTHON_VERSIONS
stage: test
parallel :
matrix :
- PYTHON_VERSIONS : [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
script:
- poetry update
- poetry install
needs: []
build_doc:
stage: test
script:
- apt-get update && apt-get install -y graphviz
- poetry install --with docs
- cd doc && make html
artifacts:
paths:
- ./doc/build/
expose_as: 'Documentation'
validate_tutorials:
stage: test
image : python:3.12 # needs to be updated when cvxpy supports python 3.13
script:
- poetry install --with tutorials
- pytest --nbval-lax ./tutorials/
pages:
# Push the latest documentation of the development branch to the GitLab Pages
# at https://cps.pages.gitlab.lrz.de/commonroad-io/
stage: deploy
needs:
- build_doc
script:
- cp -r doc/build/html public
artifacts:
paths:
- public
rules :
- if : $CI_COMMIT_BRANCH == "master"
variables :
path_prefix : ""
- if : $CI_COMMIT_BRANCH == "develop"
variables :
path_prefix : "develop"
pages:
path_prefix : "$path_prefix"
environment :
name : Gitlab Pages $CI_COMMIT_BRANCH
url : https://cps.pages.gitlab.lrz.de/commonroad-io/$path_prefix
push_to_internal_pipy_registry:
# push the development version to the internal pipy registry https://gitlab.lrz.de/cps/commonroad-io/-/packages
# before manually triggering the job, delete the previous package in case the version number didn't change
stage: deploy
when: manual
only:
- develop
script:
- poetry config repositories.gitlab ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
- poetry build
- poetry publish --repository gitlab -u gitlab-ci-token -p ${CI_JOB_TOKEN}
push_to_external_pipy_test_registry:
stage: deploy
when: manual
only:
- master
script:
- poetry config repositories.test https://test.pypi.org/legacy/
- poetry build
- poetry publish --repository test -u __token__ -p ${CR_PYPI_TEST_API_TOKEN}
push_to_external_pipy_release_registry:
stage: deploy
when: manual
only:
- master
script:
- poetry build
- poetry publish -u __token__ -p ${CR_PYPI_RELEASE_API_TOKEN}