-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
127 lines (114 loc) · 3.31 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
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
stages:
- style_check
- test
- deploy
default:
image: python:3.10
before_script:
- apt-get update && apt-get install -y cmake build-essential git pkg-config ca-certificates wget libomp-dev libeigen3-dev libboost-all-dev uuid-dev libcgal-dev
- pip install poetry
- poetry config virtualenvs.in-project true
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.lrz.de/".insteadOf "[email protected]:"
- poetry install --with tests,docs,tutorials
- source .venv/bin/activate
.run-test-with-coverage: &run-test-with-coverage
- apt-get update && apt-get install -y ffmpeg libegl1
- coverage run --source ./crdesigner -m pytest tests/
- 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"]
variables:
QT_QPA_PLATFORM : "offscreen"
script:
- *run-test-with-coverage
needs: []
build_and_update_packages_debian:
image : python:$PYTHON_VERSIONS
stage: test
parallel :
matrix :
- PYTHON_VERSIONS : [ "3.9", "3.10", "3.11" ]
script:
- poetry update
- poetry install
needs: []
build_and_test_with_coverage:
stage : test
image: python:3.11
variables :
QT_QPA_PLATFORM : "offscreen"
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
needs : [ ]
pages :
# push the latest documentation of the main branch to the Gitlab pages.
# available at https://cps.pages.gitlab.lrz.de/commonroad/commonroad-template
stage : deploy
when: manual
only :
- master
publish : site
script :
- poetry install --with docs
- mkdocs build
artifacts :
paths :
- site
environment :
name : Gitlab Pages
url : https://cps.pages.gitlab.lrz.de/commonroad-scenario-designer/
build_pages:
# Push the latest documentation of the development branch to the GitLab Pages at gitlab artifacts
stage: deploy
script:
- poetry install --with docs
- mkdocs build
artifacts:
paths :
- site
needs: []
push_to_internal_pipy_registry:
# push the development version to the internal pipy registry https://gitlab.lrz.de/cps/commonroad-scenario-designer/-/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}