-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·213 lines (184 loc) · 4 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
- test
- package
- deploy
.build_x86_64:
variables:
ARCH: x86_64
tags:
- docker
- aesrl
- x86_64
.build_arm64:
variables:
ARCH: arm64
tags:
- docker
- aesrl
- arm64
.build_armhf:
variables:
ARCH: arm
tags:
- docker
- aesrl
- armhf
.python:
before_script:
- apt-get update -qq && apt-get install cmake build-essential libclang1-15 libclang-dev libpcap-dev python3-venv python3-dev -yy
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
.build_python:
stage: build
extends: .python
script:
- make -j$(nproc) -C src/atdecc
after_script:
- echo BUILD_STATUS="${CI_JOB_STATUS}" > $CI_PROJECT_DIR/status.env
artifacts:
paths:
- src/
reports:
# environment variable BUILD_STATUS to be passed on to follow-up jobs
dotenv: status.env
build_python_x86_64:
extends:
- .build_python
- .build_x86_64
build_python_arm64:
extends:
- .build_python
- .build_arm64
build_python_armhf:
# currently, the armhf build is known to segfault
allow_failure: true
extends:
- .build_python
- .build_armhf
.test_python:
stage: test
extends:
- .python
variables:
LD_LIBRARY_PATH: $CI_PROJECT_DIR/src/atdecc
script:
- pytest
test_python_x86_64:
extends:
- .test_python
- .build_x86_64
needs:
- build_python_x86_64
dependencies:
- build_python_x86_64
test_python_arm64:
extends:
- .test_python
- .build_arm64
needs:
- build_python_arm64
dependencies:
- build_python_arm64
.build_wheel:
stage: package
extends: .python
before_script:
- test "$BUILD_STATUS" == "success" # TEST for build job success
- apt-get update -qq && apt-get install python3-venv python3-build -yy
allow_failure: true
script:
- python3 -m build
artifacts:
paths:
- dist/
build_wheel_x86_64:
extends:
- .build_wheel
- .build_x86_64
needs:
- build_python_x86_64
dependencies:
- build_python_x86_64
build_wheel_arm64:
extends:
- .build_wheel
- .build_arm64
needs:
- build_python_arm64
dependencies:
- build_python_arm64
build_wheel_armhf:
extends:
- .build_wheel
- .build_armhf
needs:
- build_python_armhf
dependencies:
- build_python_armhf
.build_debian:
stage: package
before_script:
- test "$BUILD_STATUS" == "success" # TEST for build job success
- apt-get update -qq && apt-get install git devscripts equivs python3-venv python3-dev -yy
allow_failure: true
script:
- make builddeps
- make -j$(nproc) debpkg
after_script:
- rm -f *-build-deps_*_all.deb
- mv ../${CI_PROJECT_NAME}*.deb .
artifacts:
paths:
- ./${CI_PROJECT_NAME}*.deb
expire_in: 1h
.build_debian_scheduled:
extends: .build_debian
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
build_debian_x86_64:
extends:
- .build_debian
- .build_x86_64
needs:
- build_python_x86_64
dependencies:
- build_python_x86_64
when: on_success
build_debian_arm64:
extends:
- .build_debian
- .build_arm64
needs:
- build_python_arm64
dependencies:
- build_python_arm64
when: on_success
build_debian_armhf:
extends:
- .build_debian
- .build_armhf
needs:
- build_python_armhf
dependencies:
- build_python_armhf
when: on_success
upload:
stage: deploy
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
tags:
- docker
- aesrl-website
before_script:
- apt-get update -qq
- apt-get install lftp curl -yy
script:
- if [ -z "$CI_COMMIT_TAG" ]; then export DISTRO=experimental; else export DISTRO=unstable; fi
# upload the debian repository incomings
- ./upload.sh debian/incoming/$DISTRO
# trigger debian repository update
- curl --fail --request POST --form token=$DEBIAN_TRIGGER_TOKEN --form ref=main "https://gitlab.mdw.ac.at/api/v4/projects/$DEBIAN_PROJECT_ID/trigger/pipeline"