-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
182 lines (165 loc) · 4.52 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
stages:
- maintenance
- build
- test
- plugins
.build:
script:
# install dependencies for builing mpsym and qdldl from source
- apt-get update
- apt-get install -y build-essential cmake libboost-dev libboost-graph-dev lua5.3 liblua5.3-dev luarocks
# build the wheels
- pip wheel -w wheels ."[dev]"
artifacts:
paths:
- wheels
# make pip's cache persistent across pipelines
cache:
key: "$CI_JOB_NAME"
paths:
- .cache/pip
build-python3.10:
extends: .build
stage: build
image: python:3.10
tags:
- python3.10
build-python3.9:
extends: .build
stage: build
image: python:3.9
tags:
- python3.9
build-python3.8:
extends: .build
stage: build
image: python:3.8
tags:
- python3.8
build-python3.7:
extends: .build
stage: build
image: python:3.7
tags:
- python3.7
.test:
script:
# install runtime dependencies for mpsym
- apt-get update
- apt-get install -y lua5.3 liblua5.3 luarocks
# install mocasin
- pip install "mocasin[dev]" --no-index --find-links=./wheels
# run tests
- python -m pytest
test-python3.10:
extends: .test
stage: test
image: python:3.10
tags:
- python3.10
needs:
- build-python3.10
test-python3.9:
extends: .test
stage: test
image: python:3.9
tags:
- python3.9
needs:
- build-python3.9
test-python3.8:
extends: .test
stage: test
image: python:3.8
tags:
- python3.8
needs:
- build-python3.8
test-python3.7:
extends: .test
stage: test
image: python:3.7
tags:
- python3.7
needs:
- build-python3.7
# Use API calls on downstream repositories to determine which branch to trigger
# in plugin bridge jobs
find-plugin-branches:
stage: maintenance
script:
# check branches in mocasin-gbm
- |
if [ "$CI_COMMIT_REF_NAME" != "master" ] && curl --fail --location --header "PRIVATE-TOKEN: $MOCASIN_GBM_TOKEN" "https://cc.inf.tu-dresden.de/gitlab/api/v4/projects/234/repository/branches/$CI_COMMIT_REF_NAME"; then
echo "Will trigger pipleline in mocasin-gbm using $CI_COMMIT_REF_NAME branch"
echo "MOCASIN_GBM_BRANCH=$CI_COMMIT_REF_NAME" >> plugins.env
else
echo "Will trigger pipeline in mocasin-gbm using mocasin-ci branch"
echo "MOCASIN_GBM_BRANCH=master-ci" >> plugins.env
fi
# check branches in mocasin-maps-examples
- |
if [ "$CI_COMMIT_REF_NAME" != "master" ] && curl --fail --location --header "PRIVATE-TOKEN: $MOCASIN_MAPS_EXAMPLES_TOKEN" "https://cc.inf.tu-dresden.de/gitlab/api/v4/projects/233/repository/branches/$CI_COMMIT_REF_NAME"; then
echo "Will trigger pipleline in mocasin-maps-examples using $CI_COMMIT_REF_NAME branch"
echo "MOCASIN_MAPS_EXAMPLES_BRANCH=$CI_COMMIT_REF_NAME" >> plugins.env
else
echo "Will trigger pipeline in mocasin-maps-examples using mocasin-ci branch"
echo "MOCASIN_MAPS_EXAMPLES_BRANCH=master-ci" >> plugins.env
fi
# check branches in fivegsim
- |
if [ "$CI_COMMIT_REF_NAME" != "master" ] && curl --fail --location --header "PRIVATE-TOKEN: $FIVEGSIM_TOKEN" "https://cc.inf.tu-dresden.de/gitlab/api/v4/projects/206/repository/branches/$CI_COMMIT_REF_NAME"; then
echo "Will trigger pipleline in fivegsim using $CI_COMMIT_REF_NAME branch"
echo "FIVEGSIM_BRANCH=$CI_COMMIT_REF_NAME" >> plugins.env
else
echo "Will trigger pipeline in fivegsim using mocasin-ci branch"
echo "FIVEGSIM_BRANCH=master-ci" >> plugins.env
fi
artifacts:
reports:
dotenv: plugins.env
tags:
- python3.9
test-gbm:
stage: plugins
variables:
MOCASIN_BRANCH: $CI_COMMIT_REF_NAME
needs:
- find-plugin-branches
trigger:
project: mocasin/mocasin-gbm
strategy: depend
branch: $MOCASIN_GBM_BRANCH
test-maps-examples:
stage: plugins
variables:
MOCASIN_BRANCH: $CI_COMMIT_REF_NAME
needs:
- find-plugin-branches
trigger:
project: mocasin/mocasin-maps-examples
strategy: depend
branch: $MOCASIN_MAPS_EXAMPLES_BRANCH
test-fivegsim:
stage: plugins
variables:
MOCASIN_BRANCH: $CI_COMMIT_REF_NAME
needs:
- find-plugin-branches
trigger:
project: mocasin/fivegsim
strategy: depend
branch: $FIVEGSIM_BRANCH
check-formatting:
stage: test
image: python:3.9
tags:
- python3.9
needs: []
script:
- pip install black
- black --check .