.gitlab-ci.yml 16.2 KB
Newer Older
1 2 3 4 5
# we utilize the images generated by the build-images project, to
# speed up CI runs. We also use ccache and store config.cache
# to speed up compilation. We include a version number in cache
# name to allow expiration of old caches.

6 7 8 9
stages:
  - stage1-testing
  - stage2-tarball

10
cache:
11
  key: "$CI_JOB_NAME-ver4"
12 13 14 15 16 17 18 19
  paths:
    - cache/

before_script:
  # CCache Config
  - mkdir -p cache
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/cache
20
  - echo $CCACHE_DIR
21 22 23 24 25 26
  - export CC="ccache gcc"

after_script:
  # somehow after_script looses environment
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/cache
27
  - if which ccache >/dev/null; then ccache -s; fi
28

Tim Rühsen's avatar
Tim Rühsen committed
29 30 31
variables:
  BUILD_IMAGES_PROJECT: gnuwget/build-images
  DEBIAN_BUILD: buildenv-debian-stretch
Tim Rühsen's avatar
Tim Rühsen committed
32
  DEBIAN_TESTING_BUILD: buildenv-debian-testing
33
  DEBIAN_STABLEi386_BUILD: buildenv-debian-stable-i386
34
  DEBIAN_UNSTABLE_BUILD: buildenv-debian-unstable
35
  DEBIAN_HTTP2_BUILD: buildenv-mhd-http2
36
  FEDORA_BUILD: buildenv-fedora
Tim Rühsen's avatar
Tim Rühsen committed
37
  CENTOS7_BUILD: buildenv-centos7
38
  MINGW_BUILD: buildenv-mingw
39
  ALPINE_BUILD: buildenv-alpine
40
  ARCH_BUILD: buildenv-arch
41
  BASIC_BUILD: buildenv-basic
Tim Rühsen's avatar
Tim Rühsen committed
42
  GET_SOURCES_ATTEMPTS: "3"
43
  GIT_DEPTH: "5"
44
  CONFIGURE_BASE_FLAGS: --enable-assert --cache-file cache/config.cache
45
  CFLAGS_DEFAULT: -O1 -g -ggdb3
Darshit Shah's avatar
Darshit Shah committed
46 47 48 49 50 51 52 53


# We organize the CI runners as thus:
#   1. Debian Stretch Build:
#       * ASan and UBSan builds
#       * make syntax-check
#       * make distcheck
#
54
#   2. Fedora Build
Darshit Shah's avatar
Darshit Shah committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68
#       * LLVM/Clang Build
#       * Valgrind Tests
#
#   3. CentOS7 Build
#       * Build with musl / newlib
#       * Minimal Build (All features disabled)
#
#   This way we split most of the different build options across different
#   platforms as well. Other builds we would like to have:
#
#   1. Windows
#   2. OSX
#   3. Documentation Generation and Gitlab pages
#   4. Code coverage stats
Tim Rühsen's avatar
Tim Rühsen committed
69

Tim Rühsen's avatar
Tim Rühsen committed
70
Full+VPATH/Debian:
71
  stage: stage1-testing
72 73
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
Tim Rühsen's avatar
Tim Rühsen committed
74
    - contrib/spell-checker
75
    - export CFLAGS="$CFLAGS_DEFAULT"
76
    - sed -i 's/dist-lzip//g' configure.ac
77
    - ./bootstrap --skip-po && touch .manywarnings
78
    - mkdir vpath && cd vpath
79
    - ../configure $CONFIGURE_BASE_FLAGS --cache-file ../cache/config.cache
80
    - make -j$(nproc)
81
    - make -j$(nproc) distcheck
82
    - mv wget2-*.gz ..
83 84
  tags:
    - shared
85
    - linux
86 87
  except:
    - coverity-scan@gnuwget/wget2
88 89 90 91 92 93 94 95
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
96 97 98 99 100
  artifacts:
    expire_in: 2 weeks
    when: on_success
    paths:
      - wget2-*.gz
101

102

Tim Rühsen's avatar
Tim Rühsen committed
103
# Debian Testing
104
# - Testing dash to detects bashims in configure.ac
Tim Rühsen's avatar
Tim Rühsen committed
105 106 107 108 109 110
Debian/Testing:
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_TESTING_BUILD
  script:
    - export CFLAGS="$CFLAGS_DEFAULT"
    - ./bootstrap --skip-po && touch .manywarnings
111 112
    - CONFIG_SHELL=/bin/dash dash ./configure $CONFIGURE_BASE_FLAGS -q 2>&1 >/dev/null |
        grep -v "libhsts was not found" | grep . && exit 1
Tim Rühsen's avatar
Tim Rühsen committed
113 114 115 116
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
117
    - linux
118 119
  except:
    - coverity-scan@gnuwget/wget2
Tim Rühsen's avatar
Tim Rühsen committed
120 121 122 123 124 125 126 127 128
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

129 130 131 132 133 134 135 136 137 138 139 140
# Debian Unstable
Debian/Unstable:
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_UNSTABLE_BUILD
  script:
    - export CFLAGS="$CFLAGS_DEFAULT"
    - ./bootstrap --skip-po && touch .manywarnings
    - ./configure $CONFIGURE_BASE_FLAGS
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
141
    - linux
142 143
  except:
    - coverity-scan@gnuwget/wget2
144 145 146 147 148 149 150 151 152
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

153
Debian/WolfSSL:
154 155 156 157 158
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_UNSTABLE_BUILD
  script:
    - export CFLAGS="$CFLAGS_DEFAULT"
    - ./bootstrap --skip-po && touch .manywarnings
159
    - ./configure $CONFIGURE_BASE_FLAGS --with-ssl=wolfssl
160 161 162 163
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
164
    - linux
165 166
  except:
    - coverity-scan@gnuwget/wget2
167 168 169 170 171 172 173 174
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
Tim Rühsen's avatar
Tim Rühsen committed
175

176 177 178 179 180 181 182 183 184 185 186
Debian/OpenSSL:
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_UNSTABLE_BUILD
  script:
    - export CFLAGS="$CFLAGS_DEFAULT"
    - ./bootstrap --skip-po && touch .manywarnings
    - ./configure $CONFIGURE_BASE_FLAGS --with-ssl=openssl
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
187
    - linux
188 189
  except:
    - coverity-scan@gnuwget/wget2
190 191 192 193 194 195 196 197 198
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

199 200
# In this build we combine
#  * gcc
201
#  * check, syntax-check
202
Minimal/Debian:
203
  stage: stage1-testing
204 205
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
206
    - export CFLAGS="$CFLAGS_DEFAULT"
207
    - sed -i 's/dist-lzip//g' configure.ac
208
    - ./bootstrap --skip-po && touch .manywarnings
209 210 211
    - ./configure $CONFIGURE_BASE_FLAGS --disable-doc
        --disable-xattr --without-gnutls --without-libpsl --without-libnghttp2 --without-bzip2
        --without-gpgme --without-zlib --without-lzma --without-brotlidec --without-libidn2
212
        --without-libidn --without-libpcre2 --without-libpcre --without-plugin-support
213 214
    - make -j$(nproc) -C lib
    - make -j$(nproc) check CFLAGS="$CFLAGS_DEFAULT -Werror"
215 216
  tags:
    - shared
217 218
  except:
    - coverity-scan@gnuwget/wget2
219 220 221 222 223 224 225 226 227 228 229 230
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

# In this build we combine
#  * clang
#  * ASan, UBSan
231
#  * check, syntax-check
232
Sanitizers/Debian:
233
  stage: stage1-testing
234
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_UNSTABLE_BUILD
Tim Rühsen's avatar
Tim Rühsen committed
235
  script:
236
    - export CFLAGS="$CFLAGS_DEFAULT"
237
    - ./bootstrap --skip-po && touch .manywarnings
238
    - export CC="ccache clang"
239
    - export UBSAN_OPTIONS=print_stacktrace=1:report_error_type=1
240
    - export LSAN_OPTIONS=suppressions="$PWD/tests/clang-asan-suppressions"
241
    - export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
242
    - ./configure $CONFIGURE_BASE_FLAGS --enable-fsanitize-asan --enable-fsanitize-ubsan
243 244
    - make -j$(nproc) -C lib
    - make -j$(nproc) check CFLAGS="$CFLAGS_DEFAULT -Werror"
Tim Rühsen's avatar
Tim Rühsen committed
245
  tags:
Darshit Shah's avatar
Darshit Shah committed
246
    - shared
247
    - linux
248 249
  except:
    - coverity-scan@gnuwget/wget2
Tim Rühsen's avatar
Tim Rühsen committed
250 251 252 253
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
254
      - ./*.log
255 256 257
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
Darshit Shah's avatar
Darshit Shah committed
258

259
Scan-Build/Debian:
260
  stage: stage1-testing
261
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_UNSTABLE_BUILD
262
  script:
263
    - export CFLAGS="$CFLAGS_DEFAULT"
264
    - ./bootstrap --skip-po && touch .manywarnings
265
    - CC=clang ./configure $CONFIGURE_BASE_FLAGS
Tim Rühsen's avatar
Tim Rühsen committed
266
    - make -C lib -j$(nproc)
267
    - scan-build -v --use-cc=clang -enable-checker valist,nullability --status-bugs -o scan-build make -j$(nproc)
268 269
  tags:
    - shared
270
    - linux
271 272
  except:
    - tags
273
    - coverity-scan@gnuwget/wget2
274 275 276 277 278 279
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - scan-build/*

280
Valgrind/Debian:
281
  stage: stage1-testing
282 283
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
284
    - export CFLAGS="$CFLAGS_DEFAULT"
285
    - ./bootstrap --skip-po
286
    - ./configure $CONFIGURE_BASE_FLAGS --enable-valgrind-tests
287
    - make -j$(nproc)
288
    - make check -j$(nproc)
289 290
  tags:
    - shared
291
    - linux
292 293
  except:
    - tags
294
    - coverity-scan@gnuwget/wget2
295 296
  artifacts:
    expire_in: 2 weeks
297
    when: on_failure
298
    paths:
299 300 301 302
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
303

304 305 306 307
Valgrind/i386:
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_STABLEi386_BUILD
  script:
308
    - export CFLAGS="$CFLAGS_DEFAULT"
309 310 311 312 313 314
    - ./bootstrap --skip-po
    - ./configure $CONFIGURE_BASE_FLAGS --enable-valgrind-tests --without-gpgme
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
315
    - linux
316 317
  except:
    - tags
318
    - coverity-scan@gnuwget/wget2
319 320 321 322 323 324 325 326 327
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

328
Simple/Fedora:
329
  stage: stage1-testing
Darshit Shah's avatar
Darshit Shah committed
330 331
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
332
    - export CFLAGS="$CFLAGS_DEFAULT"
333
    - ./bootstrap --skip-po && touch .manywarnings
334
    - ./configure $CONFIGURE_BASE_FLAGS
335 336
    - make -j$(nproc) -C lib
    - make -j$(nproc) check CFLAGS="$CFLAGS_DEFAULT -Werror"
Darshit Shah's avatar
Darshit Shah committed
337 338
  tags:
    - shared
339
    - linux
Darshit Shah's avatar
Darshit Shah committed
340 341
  except:
    - tags
342
    - coverity-scan@gnuwget/wget2
Darshit Shah's avatar
Darshit Shah committed
343 344 345 346
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
347 348 349 350
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
Tim Rühsen's avatar
Tim Rühsen committed
351

352
Alpine:
353
  stage: stage1-testing
354 355
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$ALPINE_BUILD
  script:
356
    - export CFLAGS="$CFLAGS_DEFAULT"
357
    - ln -s /usr/bin/python3 /usr/bin/python
358
    - ./bootstrap --skip-po
359 360 361 362
    - ./configure $CONFIGURE_BASE_FLAGS
    - make -j$(nproc) check
  tags:
    - shared
363
    - linux
364 365
  except:
    - tags
366
    - coverity-scan@gnuwget/wget2
367 368 369 370 371 372 373 374 375
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log

Tim Rühsen's avatar
Tim Rühsen committed
376
#Centos7 build:
377
#  stage: stage1-testing
Tim Rühsen's avatar
Tim Rühsen committed
378 379 380 381 382 383 384 385 386 387 388 389 390
#  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS7_BUILD
#  script:
#  - sed -i 's/AM_GNU_GETTEXT_VERSION(0.19.3)/AM_GNU_GETTEXT_VERSION(0.18.2)/g' configure.ac
#  - ./bootstrap && ./configure --enable-gcc-warnings --disable-doc && make -j$(nproc) check
#  tags:
#  - shared
#  artifacts:
#    expire_in: 2 weeks
#    when: on_failure
#    paths:
#      - tests/*.log
#      - compat_reports/

391
pages:
392
  stage: stage1-testing
393 394
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
395
    - mkdir -p public
396
    - ./bootstrap --skip-po
397
    - export CFLAGS="$CFLAGS_DEFAULT"
398
    - ./configure $CONFIGURE_BASE_FLAGS
399
    - make -j$(nproc) check-coverage
400 401

# Tarball
Tim Rühsen's avatar
Tim Rühsen committed
402
    - make dist
403 404 405 406 407 408 409 410 411
    - mv wget2-*.gz public/wget2-latest.tar.gz

# Test suite coverage report
    - coverage=$(grep -m 1 'headerCovTableEntry[a-zA-Z].*[0-9]*' lcov/index.html|sed 's/^.*>\([0-9]\+\.[0-9]\+\).*/\1/');
    - coverage=$(printf %.2f $coverage)
    - inum=$(echo $coverage|cut -d'.' -f1)
    - if [ -z "$inum" ]; then inum="0"; fi
    - contrib/make-coverage-badge "coverage" "$coverage%"
    - mv badge.svg public/coverage.svg
412 413
    - rm -rf public/coverage
    - mv lcov public/coverage
414 415

# Online Documentation
416 417
    - rm -rf public/reference
    - mv docs/html public/reference
418 419

# Coverage report for all our fuzz corpora
420
    - make -j$(nproc) fuzz-coverage
421 422 423 424 425 426
    - coverage=$(grep -m 1 'headerCovTableEntry[a-zA-Z].*[0-9]*' lcov/index.html|sed 's/^.*>\([0-9]\+\.[0-9]\+\).*/\1/');
    - coverage=$(printf %.2f $coverage)
    - inum=$(echo $coverage|cut -d'.' -f1)
    - if [ -z "$inum" ]; then inum="0"; fi
    - contrib/make-coverage-badge "fuzz-coverage" "$coverage%"
    - mv badge.svg public/fuzz-coverage.svg
427 428
    - rm -rf public/fuzz-coverage
    - mv lcov public/fuzz-coverage
429 430
  tags:
    - shared
431
    - linux
432 433 434 435 436 437
  artifacts:
    when: on_success
    paths:
      - public
  only:
    - master
Tim Rühsen's avatar
Tim Rühsen committed
438

439
MinGW64:
440
  stage: stage1-testing
441 442
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
  script:
443
    - ./bootstrap --skip-po
444 445 446 447 448 449 450 451
    - cp pthread_sigmask.c.mingw lib/pthread_sigmask.c
    - export CC="ccache $PREFIX-gcc"
    - export GCCLIB=$(dirname $(find /usr/lib/gcc/$PREFIX -name libgcc_s_seh-1.dll|grep posix))
    - export WINEPATH="$WINEPATH;/usr/$PREFIX/bin;/usr/$PREFIX/lib;$PWD/libwget/.libs;$GCCLIB"
    - echo "WINEPATH=$WINEPATH"
    - ./configure $CONFIGURE_BASE_FLAGS --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-shared
    - make -j$(nproc)
    - make check -j$(nproc) LOG_COMPILER=wine
452
  tags:
453
    - shared
454
    - linux
455
  except:
456
    - tags
457
    - coverity-scan@gnuwget/wget2
458
  allow_failure: true
459 460 461 462
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
463
      - ./config.h
464 465 466 467
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
468

469
Arch:
470
  stage: stage1-testing
471 472
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$ARCH_BUILD
  script:
Tim Rühsen's avatar
Tim Rühsen committed
473
    - export CFLAGS="$CFLAGS_DEFAULT"
474
    - sed -i 's/dist-lzip//g' configure.ac
475
    - ./bootstrap --skip-po && touch .manywarnings
476
    - ./configure $CONFIGURE_BASE_FLAGS
477 478 479 480
    - make -j$(nproc)
    - make check -j$(nproc)
  tags:
    - shared
481
    - linux
482 483
  except:
    - coverity-scan@gnuwget/wget2
484 485 486 487 488 489 490 491 492 493
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log


494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
# Test building from tarball in a non-dev environment
Tarball:
  stage: stage2-tarball
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$BASIC_BUILD
  variables:
    GIT_STRATEGY: none
  script:
    # remove all files from git repo
    - mv wget2-*.gz /tmp
    - rm -rf * .git* .travis*
    - mv /tmp/wget2-*.gz .
    # unpack and build from tarball
    - tar xvf wget2-*.gz
    - cd wget2-*
    - unset CC
    - ./configure $CONFIGURE_BASE_FLAGS --disable-manywarnings
    - make -j$(nproc)
    - make -j$(nproc) check
    # check if essential files are accidentally cleaned
    - make clean
    - make -j$(nproc)
  tags:
    - shared
517
    - linux
518
  dependencies:
Tim Rühsen's avatar
Tim Rühsen committed
519
    - Full+VPATH/Debian
520 521
  except:
    - coverity-scan@gnuwget/wget2
522 523 524 525 526 527 528 529 530 531
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - wget2-*/*.log
      - wget2-*/tests/*.log
      - wget2-*/unit-tests/*.log
      - wget2-*/fuzz/*.log


532
CommitCheck:
533
  stage: stage1-testing
534
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$BASIC_BUILD
535 536 537 538 539 540 541
  before_script:
    - /bin/true
  script:
    - ./contrib/commit-check
  after_script:
    - /bin/true
  allow_failure: true
542 543 544
  cache:
      paths:
      policy: push
545 546


547
Debian/HTTP2:
548
  stage: stage1-testing
549
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_HTTP2_BUILD
550 551 552
  script:
    - export CFLAGS="$CFLAGS_DEFAULT"
    - ./bootstrap --skip-po && touch .manywarnings
553
    - ./configure $CONFIGURE_BASE_FLAGS --enable-code-coverage
554 555
    - make -j$(nproc)
    - make check -j$(nproc)
556
    - make code-coverage-capture
557 558
  tags:
    - shared
559
    - linux
560
  allow_failure: true
561 562
  except:
    - coverity-scan@gnuwget/wget2
563 564 565 566 567 568 569 570
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - unit-tests/*.log
      - tests/*.log
571 572 573 574 575
  artifacts:
    expire_in: 2 weeks
    when: on_success
    paths:
      - wget2-*-coverage
576 577 578 579 580 581 582 583 584 585 586 587

# That is a specific runner that we cannot enable universally.
# We restrict it to builds under the $BUILD_IMAGES_PROJECT project.
FreeBSD.x86_64:
  stage: stage1-testing
  image:
  script:
    - export CC="ccache clang"
    - sed -i.bak 's/dist-lzip//g' configure.ac
    - sed -i.bak '/^python/d' bootstrap.conf
    - sed -i.bak '/^lzip/d' bootstrap.conf
    - sed -i.bak '/^makeinfo/d' bootstrap.conf
588
    - ./bootstrap --skip-po && touch .manywarnings
589
    - LIBS="-L/usr/local/lib" ./configure --cache-file cache/config.cache --disable-doc
590 591
    - gmake -j$(sysctl hw.ncpu | awk '{print $2}')
    - gmake check -j$(sysctl hw.ncpu | awk '{print $2}')
592 593 594 595 596 597
  tags:
    - freebsd
  only:
    - branches@gnuwget/wget2
  except:
    - tags
598
    - coverity-scan@gnuwget/wget2
599 600 601 602 603 604 605 606
  artifacts:
    expire_in: 1 week
    when: on_failure
    paths:
      - ./*.log
      - fuzz/*.log
      - tests/*.log
      - unit-tests/*.log
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623

coverity:
  stage: stage1-testing
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
  script:
    - wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$COVERITY_SCAN_PROJECT_NAME" -O /tmp/coverity_tool.tgz
    - tar xfz /tmp/coverity_tool.tgz
    - ./bootstrap --skip-po
    - CFLAGS="-g -Og" ./configure --cache-file cache/config.cache --disable-doc
    - cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j$(nproc)
    - 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=tim.ruehsen@gmx.de
      --form file=@cov-int.tar.gz --form version="`git describe --tags`"
      --form description="CI build"
  tags:
    - shared
624
    - linux
625 626 627 628 629 630 631
  only:
    - coverity-scan@gnuwget/wget2
  artifacts:
    expire_in: 1 week
    when: on_failure
    paths:
      - cov-int/*.txt