-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
332 lines (296 loc) · 9.95 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
variables:
FPC_OLDSTABLE_VER: 3.2.0
FPC_STABLE_VER: 3.2.2 # make sure to properly adjust FOOTER variable value in docs-fpdoc-stable job on version bump (needed only once)
FPC_FIXES_VER: 3.2.3
FPC_MAIN_VER: 3.3.1
IMAGE_TAG: $CI_REGISTRY_IMAGE/debian-x86-64:latest
QT5PAS_SRC: lcl/interfaces/qt5/cbindings
QT6PAS_SRC: lcl/interfaces/qt6/cbindings
workflow: # these rules enable pipeline for merge requests and try to avoid duplicate pipelines
rules:
# - when: never # uncomment this line to disable pipeline (useful for service needs)
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
default:
image: $IMAGE_TAG
stages: # List of stages for jobs, and their order of execution
- prepenv
- clearcaches
- prepcaches
- build
.runscheduled: # this hidden job defines a rule, which, if referenced by job, enables it to always run in scheduled pipeline
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
.manualjob: # this hidden job defines a rule, which, if referenced by job, allows it to be skipped without errors
rules:
- when: manual
allow_failure: true
.onsuccessjob: # this hidden job defines a rule, which, if referenced by job, configures it to be run when previous ones completed successfully
rules:
- when: on_success
update-build-env: # This job updates building environment image. Run it if FPC version constants and/or Dockerfile.buildenv were changed.
stage: prepenv
image: docker
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --pull
--build-arg FPC_OLDSTABLE_VER=$FPC_OLDSTABLE_VER
--build-arg FPC_STABLE_VER=$FPC_STABLE_VER
--build-arg FPC_FIXES_VER=$FPC_FIXES_VER
--build-arg FPC_MAIN_VER=$FPC_MAIN_VER
-t $IMAGE_TAG - < Dockerfile.buildenv
- docker push $IMAGE_TAG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
allow_failure: true
- when: never
clear-qt5pas-bindings: # clear Qt5 Pascal bindings cache if changes are detected, as in this case full rebuild is needed
stage: clearcaches
script:
- echo "Clearing Qt5Pas bindings cache."
cache:
key: qt5pas-cache-$CI_COMMIT_REF_SLUG
policy: push
untracked: true
rules:
- changes:
- $QT5PAS_SRC/**/*
clear-qt6pas-bindings: # clear Qt6 Pascal bindings cache if changes are detected, as in this case full rebuild is needed
stage: clearcaches
script:
- echo "Clearing Qt6Pas bindings cache."
cache:
key: qt6pas-cache-$CI_COMMIT_REF_SLUG
policy: push
untracked: true
rules:
- changes:
- $QT6PAS_SRC/**/*
update-qt5pas-bindings: # build and cache Qt5 Pascal bindings
stage: prepcaches
script:
- cd $QT5PAS_SRC
- qmake -query
- qmake
- make
cache:
key: qt5pas-cache-$CI_COMMIT_REF_SLUG
paths:
- $QT5PAS_SRC/
update-qt6pas-bindings: # build and cache Qt6 Pascal bindings
stage: prepcaches
script:
- cd $QT6PAS_SRC
- qmake6 -query
- qmake6
- make
cache:
key: qt6pas-cache-$CI_COMMIT_REF_SLUG
paths:
- $QT6PAS_SRC/
.useqt5cache: # this hidden job defines cache configuration used by Qt5 IDE building jobs
script:
- cd $QT5PAS_SRC # install Qt5 Pascal bindings
- make install
- cd $CI_PROJECT_DIR
cache:
key: qt5pas-cache-$CI_COMMIT_REF_SLUG
policy: pull
paths:
- $QT5PAS_SRC/
.useqt6cache: # this hidden job defines cache configuration used by Qt6 IDE building jobs
script:
- cd $QT6PAS_SRC # install Qt6 Pascal bindings
- make install
- cd $CI_PROJECT_DIR
cache:
key: qt6pas-cache-$CI_COMMIT_REF_SLUG
policy: pull
paths:
- $QT6PAS_SRC/
x86_64-gtk2-oldstable:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk2
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-gtk2-stable:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk2
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]
x86_64-gtk2-fixes:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_FIXES_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk2
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-gtk2-main:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk2
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-gtk3-oldstable:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk3
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-gtk3-stable:
stage: build
script:
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=gtk3
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]
x86_64-qt5-oldstable:
extends: .useqt5cache
stage: build
script:
- !reference [.useqt5cache, script]
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=qt5
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]
x86_64-qt5-stable:
extends: .useqt5cache
stage: build
script:
- !reference [.useqt5cache, script]
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=qt5
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-qt6-oldstable:
extends: .useqt6cache
stage: build
script:
- !reference [.useqt6cache, script]
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=qt6
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-qt6-stable:
extends: .useqt6cache
stage: build
script:
- !reference [.useqt6cache, script]
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 CPU_TARGET=x86_64 LCL_PLATFORM=qt6
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]
i386-win32-oldstable:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcross386 OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
i386-win32-stable:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcross386 OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]
i386-win32-fixes:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_FIXES_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_FIXES_VER/ppcross386 OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
i386-win32-main:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcross386 OS_TARGET=win32 CPU_TARGET=i386 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-win64-oldstable:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_OLDSTABLE_VER/ppcx64 OS_TARGET=win64 CPU_TARGET=x86_64 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
x86_64-win64-stable:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64
- make bigide FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 OS_TARGET=win64 CPU_TARGET=x86_64 LCL_PLATFORM=win32
rules:
- !reference [.runscheduled, rules]
- !reference [.manualjob, rules]
.docs-build:
stage: build
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64
- cd docs/html
- unzip -j /doc-chm.zip -d ../chm
- $CI_PROJECT_DIR/lazbuild --compiler=/usr/lib/fpc/$FPC_STABLE_VER/ppcx64 --lazarusdir=$CI_PROJECT_DIR build_lcl_docs.lpi
- ./build_lcl_docs --fpdoc /usr/bin/fpdoc-$FPDOC_VER --fpcdocs=../chm --outfmt chm --footer $FOOTER
- ./build_lcl_docs --fpdoc /usr/bin/fpdoc-$FPDOC_VER --fpcdocs=../chm --outfmt html --footer $FOOTER
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- docs/chm/
- docs/html/lcl/lcl/
- docs/html/lazutils/lazutils/
expire_in: 1 week
docs-fpdoc-main:
extends: .docs-build
variables:
FPDOC_VER: $FPC_MAIN_VER
FOOTER: "@locallclfooter.xml"
rules:
- !reference [.manualjob, rules]
docs-fpdoc-fixes:
extends: .docs-build
variables:
FPDOC_VER: $FPC_FIXES_VER
FOOTER: "@locallclfooter.xml"
rules:
- !reference [.manualjob, rules]
docs-fpdoc-stable:
extends: .docs-build
variables:
FPDOC_VER: $FPC_STABLE_VER
FOOTER: "locallclfooter.xml"
rules:
- !reference [.manualjob, rules]
tests-codetools: # run Codetools tests and output results in JUnit format (for this FPC 3.3.1 and up is needed)
stage: build
variables:
OUTPUT_FILE: testresults_codetools.xml
script:
- make lazbuild FPC=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64
- cd components/codetools/tests
- $CI_PROJECT_DIR/lazbuild --compiler=/usr/lib/fpc/$FPC_MAIN_VER/ppcx64 --lazarusdir=$CI_PROJECT_DIR runtestscodetools.lpi
- FPCDIR=/fpcsrc/$FPC_MAIN_VER ./runtestscodetools --all --format=junit --file=$CI_PROJECT_DIR/$OUTPUT_FILE
artifacts:
when: always
paths:
- $OUTPUT_FILE
reports:
junit: $OUTPUT_FILE
rules:
- !reference [.runscheduled, rules]
- !reference [.onsuccessjob, rules]