-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
543 lines (507 loc) · 15.7 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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# Copyright (C) 2016-2021 Simon Josefsson
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
stages:
- quick
- build
- test
# The quick stage should complete as quickly as possible but still
# excercise the internal self-tests. Primarily this is achieved by
# --disable-doc and thus avoiding the 'make dist' step. Having an
# early stage like this avoids wasting build cycles attempting the
# bootstrap builds on many platforms.
# The build stage should attempt to build from version controlled
# sources on platforms we support development on, with the variety of
# pre-dependencies that we want to support. Typically these builds
# results in a tarball artifact.
# The test stage attempt to build the tarball on all platforms we
# support building the project on, with as many combinations of
# pre-depencencies as useful.
variables:
BUILD_IMAGES_PROJECT: libidn/build-images
DEBIAN_BUILD: buildenv-debian-buster
FEDORA_BUILD: buildenv-fedora
BASE_BUILD: buildenv-basic
GET_SOURCES_ATTEMPTS: "3"
B-Debian-mini:
image: $CI_REGISTRY/libidn/build-images:libidn2-Debian-testing-mini
stage: quick
script:
- time ./bootstrap --skip-po --no-git
- time ./configure --enable-gcc-warnings --disable-doc || (cat config.log; exit 1)
- time make syntax-check gnulib_dir=$GNULIB_SRCDIR
- time make V=1
- time make check || (find . -name test-suite.log -exec cat {} +; exit 1)
sast:
stage: quick
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
variables:
SAST_EXCLUDED_PATHS: examples, fuzz, tests, lib/gendata.c, lib/gentr46map.c
include:
- template: Security/SAST.gitlab-ci.yml
B-Alpine-mini:
image: $CI_REGISTRY/libidn/build-images:libidn2-Alpine-mini
stage: build
script:
- time ./bootstrap --skip-po --no-git
- time ./configure --enable-gcc-warnings --disable-doc || (cat config.log; exit 1)
- time make V=1
- time make check || (find . -name test-suite.log -exec cat {} +; exit 1)
B-Centos7:
image: $CI_REGISTRY/libidn/build-images:libidn2-Centos7
stage: build
script:
- time ./bootstrap --skip-po --no-git
- time ./configure || (cat config.log; exit 1)
- time make V=1
- time make check || (find . -name test-suite.log -exec cat {} +; exit 1)
- time make dist
artifacts:
expire_in: 2 weeks
paths:
- libidn2-*.tar.gz
B-Centos8:
image: $CI_REGISTRY/libidn/build-images:libidn2-Centos8
stage: build
script:
- time ./bootstrap --skip-po --no-git
- time ./configure || (cat config.log; exit 1)
- time make V=1
- time make check || (find . -name test-suite.log -exec cat {} +; exit 1)
- time make dist
artifacts:
expire_in: 2 weeks
paths:
- libidn2-*.tar.gz
B-Debian-stable:
image: $CI_REGISTRY/libidn/build-images:libidn2-Debian-stable
stage: build
script:
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -q autopoint help2man
- ./bootstrap --skip-po --no-git
- ./configure --enable-gcc-warnings --enable-valgrind-tests || (cat config.log; exit 1)
- make V=1
- make check || (find . -name test-suite.log -exec cat {} +; exit 1)
- make dist
artifacts:
expire_in: 2 weeks
paths:
- libidn2-*.tar.gz
B-Debian-testing:
image: debian:testing
stage: build
before_script:
- apt-get update -qq -y
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -q git autoconf automake libtool gettext texinfo gperf git2cl libunistring-dev gtk-doc-tools valgrind gengetopt help2man abi-compliance-checker autoconf-archive autopoint texlive abigail-tools
script:
- ./bootstrap --skip-po
- ./configure --enable-gcc-warnings --enable-valgrind-tests || (cat config.log; exit 1)
- make V=1
- make check || (find . -name test-suite.log -exec cat {} +; exit 1)
- make dist
artifacts:
expire_in: 2 weeks
paths:
- libidn2-*.tar.gz
B-armcross:
image: $CI_REGISTRY/libidn/build-images:libidn2-Debian-testing-mini
stage: build
before_script:
- apt-get update -qq -y
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -q gcc-arm-linux-gnueabi qemu-user qemu-user-binfmt file
- update-binfmts --enable qemu-arm
script:
- ./bootstrap --skip-po --no-git
- ./configure --enable-gcc-warnings --disable-doc || (cat config.log; exit 1)
- make V=1
- ./configure --enable-gcc-warnings --disable-doc --host=arm-linux-gnueabi CFLAGS="-static --static" || (cat config.log; exit 1)
- make V=1
- file src/idn2
- LANG=C.UTF-8 qemu-arm src/idn2 --debug foo
- make check
T-Debian-oldoldstable:
image: debian:oldoldstable
stage: test
needs: [B-Debian-stable]
before_script:
- apt-get update
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-Debian-oldstable:
image: debian:oldstable
stage: test
needs: [B-Debian-stable]
before_script:
- apt-get update
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-Alpine:
image: alpine:latest
stage: test
needs: [B-Debian-testing]
before_script:
- echo "ipv6" >> /etc/modules
- apk update
- apk add build-base
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-ArchLinux:
image: archlinux:latest
stage: test
needs: [B-Debian-stable]
before_script:
- pacman -Sy --noconfirm make gcc diffutils
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-CentOS7:
image: centos:7
stage: test
needs: [B-Debian-stable]
before_script:
- yum -y install make gcc diffutils valgrind libunistring-devel
script:
- tar xfa libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-CentOS8:
image: centos:8
stage: test
needs: [B-Debian-stable]
before_script:
- dnf --enablerepo=powertools -y install make gcc diffutils valgrind libunistring-devel
script:
- tar xfa libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-Ubuntu-14.04:
image: ubuntu:14.04
stage: test
needs: [B-Debian-stable]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc
script:
- tar xfa libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-Ubuntu rolling:
image: ubuntu:rolling
stage: test
needs: [B-Debian-stable]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq git make gcc gtk-doc-tools texinfo texlive texlive-plain-generic dblatex
script:
- tar xfa libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
- make distcheck
artifacts:
expire_in: 2 weeks
paths:
- libidn2-*.tar.gz
T-Mingw32:
image: debian:latest
stage: test
needs: [B-Debian-stable]
before_script:
- dpkg --add-architecture i386
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make mingw-w64 wine wine32 libwine libwine:i386 binfmt-support wine-binfmt
- update-binfmts --enable wine
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --host=i686-w64-mingw32 CC='i686-w64-mingw32-gcc -static-libgcc' --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-Mingw64:
image: debian:latest
stage: test
needs: [B-Debian-stable]
before_script:
- dpkg --add-architecture i386
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make mingw-w64 wine wine32 wine64 binfmt-support wine-binfmt
- update-binfmts --enable wine
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --host=x86_64-w64-mingw32 --enable-gcc-warnings || (cat config.log; exit 1)
- make check V=1 || (find . -name test-suite.log -exec cat {} +; exit 1)
T-armcross:
image: debian:latest
stage: test
needs: [B-Debian-stable]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc-arm-linux-gnueabi
script:
- tar xfz libidn2-*.tar.gz
- cd `ls -d libidn2-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --host=arm-linux-gnueabi --enable-gcc-warnings || (cat config.log; exit 1)
- make V=1
- arm-linux-gnueabi-readelf -h lib/.libs/libidn2.so
- arm-linux-gnueabi-readelf -h src/.libs/idn2
# In this build we combine
# * fuzz/ building
# * build/valgrind-check
Debian GNU/Linux:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- ./configure -C --disable-doc --enable-gcc-warnings --enable-valgrind-tests
- echo "nproc="$(nproc)" "$nproc
- make -j$(nproc) check
- make -j$(nproc) -C fuzz
tags:
- shared
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./config.h
- ./*.log
- tests/*.log
# In this build we combine
# * syntax-check
# * abi-check
# It is not run on tags
abi-check:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- CFLAGS="-g -Og" ./configure -C --disable-doc
- make syntax-check
- make -j$(nproc)
- make abi-check
tags:
- shared
except:
- tags
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./config.h
- ./*.log
- tests/*.log
- compat_reports/
# In this build we do
# * distcheck
dist-check:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- ./configure -C --enable-gtk-doc --enable-gtk-doc-pdf --disable-gcc-warnings --disable-valgrind-tests
- make -j$(nproc)
- DISTCHECK_CONFIGURE_FLAGS=--disable-gtk-doc make distcheck
tags:
- shared
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- libidn2-*
artifacts:
expire_in: 2 weeks
when: on_success
paths:
- ./config.h
- ./*.log
- libidn2-*.gz
# In this build we combine
# * build/asan-check
# * build w/Werror and ubsan-check
Debian ASAN/UBSAN:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- export CC=clang
- export CFLAGS="-fsanitize=address -g -O0"
- ASAN_OPTIONS=detect_leaks=0 ./configure --disable-doc --disable-gcc-warnings
- make -j$(nproc) check
- make clean
- export CFLAGS="-fsanitize=undefined,integer -fno-sanitize-recover=undefined,integer -g -O0"
- ./configure --disable-doc --disable-gcc-warnings
- make -C unistring
- make -C gl
- make -C lib CFLAGS="$CFLAGS -Wall -Wextra -Werror"
- make -C examples CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wno-unused-parameter"
- make -j$(nproc) check
tags:
- shared
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./config.h
- ./*.log
- tests/*.log
clang-analyzer/Fedora:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./bootstrap --skip-po
- scan-build ./configure --disable-doc --enable-gcc-warnings
- make -j$(nproc) -C gl
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib
tags:
- shared
except:
- tags
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./config.h
- ./*.log
- scan-build-lib/*
pages:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- CFLAGS="-g -O0" ./configure --enable-gtk-doc --enable-code-coverage --disable-gcc-warnings
- make -j$(nproc) check
- make local-code-coverage-output
- mkdir -p public
- rm -rf public/coverage
- mv Libidn2-*-coverage public/coverage
- rm -rf public/reference
- mv doc/reference/html public/reference
- make web-manual
- rm -rf public/manual
- mv doc/manual public/manual
- make clean
- make
- make -C fuzz check
- make code-coverage-capture
- contrib/make-coverage-badge "fuzz-coverage"
- rm -rf public/fuzz-coverage
- mv Libidn2-*-coverage public/fuzz-coverage
- mv badge.svg public/fuzz-coverage/
tags:
- shared
artifacts:
when: on_success
paths:
- public
only:
- master
# Target to run code coverage on non-master branches. That is intended
# to ensure that compilation in master will not break the pages rule.
pages-test:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
script:
- ./bootstrap --skip-po
- CFLAGS="-g -O0" ./configure --enable-gtk-doc --enable-code-coverage --disable-gcc-warnings
- make -j$(nproc) check
- make local-code-coverage-output
- make web-manual
- make clean
- make
- make -C fuzz check
- make code-coverage-capture
- contrib/make-coverage-badge "fuzz-coverage"
tags:
- shared
except:
- master
MinGW64:
stage: build
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
before_script:
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
- echo ':DOSWin:M::MZ::/usr/bin/wine64:' > /proc/sys/fs/binfmt_misc/register
script:
- ./bootstrap --skip-po
- mingw64-configure --disable-valgrind-tests --disable-doc
- mingw64-make -j$(nproc)
- mingw64-make -j$(nproc) check
tags:
- shared
- docker
except:
- tags
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- ./config.h
- ./*.log
- tests/*.log
# After having issues with building from tarball (make distcheck was ok),
# outside a git repo, we test the tarball stand-alone.
Tarball:
stage: test
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$BASE_BUILD
variables:
GIT_STRATEGY: none
script:
# remove all files from git repo
- mv libidn2-*.gz /tmp
- rm -rf * .git* .travis*
- mv /tmp/libidn2-*.gz .
# unpack and build from tarball
- tar xvf libidn2-*.gz
- cd libidn2-*
- ./configure || (cat config.log; exit 1)
- make
- make check || (find . -name test-suite.log -exec cat {} +; exit 1)
# check if essential files are accidentally cleaned
- make clean
- make
tags:
- shared
dependencies:
- dist-check
artifacts:
expire_in: 2 weeks
when: on_failure
paths:
- libidn2-*/config.h
- libidn2-*/*.log
- libidn2-*/*/*.log