aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 0d42e9c51ce6c23d651bc15aeffe97fce3db90df (plain) (blame)
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
# 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.

cache:
  key: "$CI_JOB_NAME-ver1"
  paths:
    - cache/

before_script:
  # CCache Config
  - mkdir -p cache
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/cache
  - export CC="ccache gcc"

after_script:
  # somehow after_script looses environment
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/cache
  - ccache -s

variables:
  BUILD_IMAGES_PROJECT: libmicrohttpd/build-images
  DEBIAN_BUILD: buildenv-debian-stretch
  MINGW_BUILD: buildenv-debian-mingw
  GET_SOURCES_ATTEMPTS: "3"
  CONFIGURE_BASE_FLAGS: --enable-asserts --cache-file cache/config.cache
  CFLAGS_DEFAULT: -O0 -g -ggdb3 -Wall -Wextra

# In this build we combine
#  * gcc
#  * check
gcc/Stretch:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
    - export CFLAGS=$CFLAGS_DEFAULT
    - ./bootstrap
    - ./configure $CONFIGURE_BASE_FLAGS
    - make -j$(nproc)
    - make check
  tags:
    - shared
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - src/*/*.log
      - src/*/*/*.log

# In this build we combine
#  * clang
#  * ASan, UBSan
#  * check
Sanitizers/Stretch:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
    - export CFLAGS="$CFLAGS_DEFAULT -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address"
    - ./bootstrap
    - export CC="ccache clang"
    - export UBSAN_OPTIONS=print_stacktrace=1
    - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.8/bin/llvm-symbolizer
    - ./configure $CONFIGURE_BASE_FLAGS --disable-doc
    - make check
  tags:
    - shared
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - ./*.log
      - src/*/*.log
      - src/*/*/*.log

Scan-Build/Debian:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
    - export CFLAGS=$CFLAGS_DEFAULT
    - ./bootstrap
    - scan-build ./configure $CONFIGURE_BASE_FLAGS
    - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make -j$(nproc)
    - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make check
  tags:
    - shared
  except:
    - tags
  artifacts:
    expire_in: 2 weeks
    when: on_failure
    paths:
      - scan-build/*

MinGW/Debian:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
  script:
    - export CC="ccache $PREFIX-gcc"
    - ./bootstrap
    - ./configure $CONFIGURE_BASE_FLAGS --build=x86_64-pc-linux-gnu --host=$PREFIX
    - make -j$(nproc)

dist/Stretch:
  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  script:
    - export CFLAGS=$CFLAGS_DEFAULT
    - ./bootstrap
    - ./configure $CONFIGURE_BASE_FLAGS
    - make -j$(nproc) dist
  tags:
    - shared
  artifacts:
    name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
    expire_in: 2 weeks
    when: on_success
    paths:
      - ./libmicrohttpd-*.*.*.tar.??