-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
575 lines (540 loc) · 16.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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# Copyright (C) 2016-2024 Free Software Foundation, Inc.
#
# This file is part of LIBTASN1.
#
# 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/>.
workflow:
rules:
- if: $CI_COMMIT_BRANCH
variables:
GIT_SUBMODULE_STRATEGY: normal
BUILD_IMAGES_PROJECT: gnutls/build-images
FEDORA_BUILD: buildenv-fedora33
GET_SOURCES_ATTEMPTS: "3"
.test:
artifacts:
expire_in: 2 weeks
when: always
paths:
- "*.tar.gz"
- ./*.log
- ./config.h
- ./**/*.log
# See http://doc.gitlab.com/ce/ci/yaml/ for documentation.
x86-64:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
stage: build
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- ./configure --disable-doc && make -j$(nproc)
- make syntax-check
- make -j$(nproc) check
- make dist
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- libtasn1-*.tar.gz
- ./*.log
- ./tests/*.log
artifacts:
expire_in: 1 week
when: on_success
paths:
- libtasn1-*.tar.gz
B-gcc:
image: gcc:latest
stage: build
before_script:
- apt-get update -qq
- apt-get install -y -qq --no-install-recommends bison texinfo help2man valgrind
script:
- gcc --version
- ./bootstrap
- ./configure CC="gcc -std=gnu2x"
- make V=1 VERBOSE=t check clean
- ./configure CC="gcc -std=c23"
- make V=1 all check dist
- git status
- git diff --exit-code
B-clang:
image: silkeh/clang:latest
stage: build
before_script:
- apt-get update -qq
- apt-get install -y -qq --no-install-recommends git libtool bison texinfo help2man
script:
- clang --version
- ./bootstrap
- ./configure CC="clang -std=gnu2x"
- make V=1 VERBOSE=t check clean
- ./configure CC="clang -std=c23"
- make V=1 VERBOSE=t check dist
- git status
- git diff --exit-code
Debian10-bootstrap:
image: debian:10-slim
stage: build
before_script:
- apt-get update -qq | tail
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git autoconf automake libtool bison texinfo texlive texlive-generic-recommended texlive-extra-utils help2man gtk-doc-tools valgrind abigail-tools | tail
script:
- ./bootstrap
- mkdir b
- cd b
- ../configure --enable-gcc-warnings
- make -j$(nproc)
- make -j$(nproc) check
- make abi-check
- make syntax-check distcheck
- git diff --exit-code # nothing should change version controlled files
artifacts:
expire_in: 2 weeks
when: on_success
paths:
- b/libtasn1-*.tar.gz
Debian11-bootstrap:
image: debian:11-slim
stage: build
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git autoconf automake libtool bison texinfo help2man gtk-doc-tools valgrind abigail-tools codespell | tail
script:
- ./bootstrap
- ./configure --enable-gcc-warnings
- make -j$(nproc)
- make -j$(nproc) check
- make abi-check
- make syntax-check dist
- git diff --exit-code # nothing should change version controlled files
artifacts:
expire_in: 2 weeks
when: on_success
paths:
- libtasn1-*.tar.gz
Debian-testing-bootstrap:
image: debian:testing-slim
stage: build
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git autoconf automake libtool bison texinfo help2man gtk-doc-tools valgrind abigail-tools indent codespell | tail
script:
- ./bootstrap
- ./configure --enable-gcc-warnings
- make -j$(nproc)
- make -j$(nproc) check
- make syntax-check distcheck
- git diff --exit-code # nothing should change version controlled files
artifacts:
expire_in: 2 weeks
when: on_success
paths:
- libtasn1-*.tar.gz
valgrind/werror:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-O2 -g -Werror" ./configure --disable-doc --enable-valgrind-tests && make -j$(nproc)
- make -j$(nproc) check
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- ./*.log
- ./tests/*.log
clang:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- CC=clang ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc)
- make check -j$(nproc)
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- ./*.log
- ./tests/*.log
asan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-fsanitize=address -g -O2" LDFLAGS="-static-libasan" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- ./*.log
- ./tests/*.log
ubsan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g -O2" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- ./*.log
- ./tests/*.log
MinGW32-bootstrap:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- dnf install -y wine.i686 mingw32-gcc util-linux
- dnf remove -y mingw32-libtasn1
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
- echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
- ./bootstrap && rm -f tests/suite/mini-eagain2.c && mkdir -p build && cd build &&
mingw32-configure --disable-doc --disable-valgrind-tests &&
mingw32-make -j$(nproc) && mingw32-make -C tests check -j$(nproc)
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- build/*.log
- build/tests/*.log
- build/tests/*/*.log
gnutls:
when: manual # takes ~1 hour...
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- ./configure --disable-doc --prefix=/usr --libdir=/usr/lib64 &&
make -j$(nproc) && make install
- git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
- cd gnutls-git && git submodule update --init && ./bootstrap &&
./configure --disable-cxx --disable-guile --disable-doc && make -j$(nproc) &&
make -j $(nproc) check
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- gnutls-git/guile/tests/*.log
- gnutls-git/tests/*.log
- gnutls-git/*.log
- gnutls-git/tests/*/*.log
- gnutls-git/tests/suite/*/*.log
static-analyzers:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./bootstrap
- scan-build ./configure --disable-doc
- make -j$(nproc) syntax-check
- make -j$(nproc) -C lib/gl
- make -j$(nproc) -C lib ASN1.lo
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- scan-build-lib/
# https://www.synopsys.com/blogs/software-security/integrating-coverity-scan-with-gitlab-ci/
Coverity:
rules:
- if: $CI_COMMIT_REF_PROTECTED == "true"
- when: manual
image: debian:12-slim
stage: build
allow_failure: true
before_script:
- apt-get update -qq | tail
- apt-get install -y -qq make git autoconf automake libtool bison gtk-doc-tools curl | tail
script:
- test -n "$COVERITY_SCAN_TOKEN" && test -n "$COVERITY_SCAN_PROJECT_NAME"
- curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
- sha1sum /tmp/cov-analysis-linux64.tgz
- tar xfz /tmp/cov-analysis-linux64.tgz
- time ./bootstrap --skip-po
- time ./configure --enable-gcc-warnings --disable-doc CFLAGS="-g -Og"
- cov-analysis-linux64-*/bin/cov-build --dir cov-int make check -j$(nproc)
- cov-analysis-linux64-*/bin/cov-build version || true
- tar cfz cov-int.tar.gz cov-int
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
--form file=@cov-int.tar.gz --form version="`git describe --tags`"
--form description="`git describe --tags` / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
artifacts:
expire_in: 1 week
paths:
- cov-int/*.txt
armcross:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -q make gcc-arm-linux-gnueabi qemu-user qemu-user-binfmt file
- update-binfmts --enable qemu-arm
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- mkdir b
- cd b
- ../configure --host=arm-linux-gnueabi --enable-gcc-warnings CFLAGS="-static --static"
- make V=1
- arm-linux-gnueabi-readelf -h lib/.libs/libtasn1.a
- arm-linux-gnueabi-readelf -h src/asn1Parser
- file src/asn1Parser
- LANG=C.UTF-8 qemu-arm src/asn1Parser -c ../tests/pkix.asn
- make check
Mingw32:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
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 xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --host=i686-w64-mingw32 CC='i686-w64-mingw32-gcc -static-libgcc' --enable-gcc-warnings
- make check V=1
Mingw64:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make mingw-w64 wine wine64 binfmt-support wine-binfmt
- update-binfmts --enable wine
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --host=x86_64-w64-mingw32 --enable-gcc-warnings
- make check V=1
Alpine:
extends: .test
image: alpine:latest
stage: test
needs: [Debian11-bootstrap]
before_script:
- echo "ipv6" >> /etc/modules
- apk update
- apk add build-base
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- sed -i 's/UNKNOWN/10.11.12/g' tests/version.c # XXX FIXME alpine bug?
- make check V=1
ArchLinux:
extends: .test
image: archlinux:latest
stage: test
needs: [Debian11-bootstrap]
before_script:
- pacman -Sy --noconfirm make gcc diffutils
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make check V=1
OracleLinux7:
extends: .test
image: oraclelinux:7
stage: test
needs: [Debian11-bootstrap]
before_script:
- yum -y install make gcc diffutils valgrind texinfo
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- sed -i -e 's/ --sort=name//' GNUmakefile # C7's tar too old for 'make dist'
- ./configure --enable-gcc-warnings
- make check V=1 VERBOSE=t
AlmaLinux8-c89:
extends: .test
image: almalinux:8
stage: test
needs: [Debian11-bootstrap]
before_script:
- yum -y install make gcc diffutils
script:
- tar xfz libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings ac_cv_prog_cc_c11=-std=c89
- make check V=1 VERBOSE=t WERROR_CFLAGS='-Dinline= -Werror -Wno-error=unused-function -Wno-error=nested-externs -Wno-error=implicit-function-declaration'
Debian4:
extends: .test
image: debian/eol:etch
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc libc-dev
- dpkg -l | cat
script:
- tar xfz libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make check V=1 VERBOSE=t
Debian8:
extends: .test
image: debian/eol:jessie
stage: test
needs: [x86-64]
before_script:
- printf "deb http://archive.debian.org/debian/ jessie main contrib non-free\ndeb http://archive.debian.org/debian/ jessie-backports main contrib non-free\ndeb http://archive.debian.org/debian-security/ jessie/updates main contrib non-free" > /etc/apt/sources.list
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings --disable-doc
- make check V=1 VERBOSE=t
Debian9-distcheck:
extends: .test
image: debian:9-slim
stage: test
needs: [x86-64]
before_script:
- printf "deb http://archive.debian.org/debian/ stretch main contrib non-free\ndeb http://archive.debian.org/debian/ stretch-backports main contrib non-free\ndeb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free" > /etc/apt/sources.list
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc gtk-doc-tools texinfo texlive texlive-generic-recommended texlive-extra-utils
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make distcheck V=1
Debian11-distcheck:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc gtk-doc-tools texinfo
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make distcheck V=1
Ubuntu-latest-distcheck:
extends: .test
image: ubuntu:latest
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc gtk-doc-tools texinfo
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make distcheck V=1
Ubuntu-rolling-distcheck:
extends: .test
image: ubuntu:rolling
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make gcc gtk-doc-tools texinfo
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure --enable-gcc-warnings
- make distcheck V=1
tcc-lld:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make tcc binutils lld
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure CC=tcc LD=lld --disable-shared
- make check V=1 VERBOSE=t
pcc:
extends: .test
image: debian:11-slim
stage: test
needs: [Debian11-bootstrap]
before_script:
- apt-get update -qq
- env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make pcc binutils libc6-dev libtasn1-bin
script:
- tar xfa libtasn1-*.tar.gz
- cd `ls -d libtasn1-* | grep -v tar.gz`
- ./configure CC=pcc
- make V=1 VERBOSE=t -C lib
- make V=1 VERBOSE=t -C fuzz check
- sed -i 's/exit 1/exit 77/' tests/parser.sh
- sed -i 's/diff/diff -u/' tests/parser.sh
- ln -s /usr/bin/asn1Parser src/
- ln -s /usr/bin/asn1Decoding src/
- ln -s /usr/bin/asn1Coding src/
- make V=1 VERBOSE=t -C tests check
.pages:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- dnf install -y dblatex
- ./bootstrap
- CFLAGS="-g -Og" dash ./configure --enable-code-coverage --enable-gtk-doc --enable-gtk-doc-pdf --disable-gcc-warnings
- mkdir -p public
- make -j$(nproc)
- make -j$(nproc) check
- make local-code-coverage-output || true
- make -C doc libtasn1.html libtasn1.pdf
- mv doc/libtasn1.pdf doc/libtasn1.html public/
- cp -ar GNU*-coverage/ public/coverage
- cp public/libtasn1.html public/index.html
- rm -rf public/reference
- mv doc/reference/html public/reference
- mv doc/reference/libtasn1.pdf public/reference/
- make web-manual
- rm -rf public/manual
- mv doc/manual public/manual
artifacts:
when: on_success
paths:
- public
pages:
extends: .pages
only:
- master
pages-test:
extends: .pages
except:
- master