.gitlab-ci.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # we utilize the images generated by the build-images project, to
  2. # speed up CI runs. We also use ccache and store config.cache
  3. # to speed up compilation. We include a version number in cache
  4. # name to allow expiration of old caches.
  5. cache:
  6. key: "$CI_JOB_NAME-ver1"
  7. paths:
  8. - cache/
  9. before_script:
  10. # CCache Config
  11. - mkdir -p cache
  12. - export CCACHE_BASEDIR=${PWD}
  13. - export CCACHE_DIR=${PWD}/cache
  14. - export CC="ccache gcc"
  15. after_script:
  16. # somehow after_script looses environment
  17. - export CCACHE_BASEDIR=${PWD}
  18. - export CCACHE_DIR=${PWD}/cache
  19. - ccache -s
  20. variables:
  21. BUILD_IMAGES_PROJECT: libmicrohttpd/build-images
  22. DEBIAN_BUILD: buildenv-debian-stretch
  23. MINGW_BUILD: buildenv-debian-mingw
  24. GET_SOURCES_ATTEMPTS: "3"
  25. CONFIGURE_BASE_FLAGS: --enable-asserts --cache-file cache/config.cache
  26. CFLAGS_DEFAULT: -O0 -g -ggdb3 -Wall -Wextra
  27. # In this build we combine
  28. # * gcc
  29. # * check, distcheck
  30. gcc/Stretch:
  31. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  32. script:
  33. - export CFLAGS=$CFLAGS_DEFAULT
  34. - ./bootstrap
  35. - ./configure $CONFIGURE_BASE_FLAGS
  36. - make -j$(nproc)
  37. - make check
  38. - make -j$(nproc) distcheck
  39. tags:
  40. - shared
  41. artifacts:
  42. expire_in: 2 weeks
  43. when: on_failure
  44. paths:
  45. - ./*.log
  46. - src/*/*.log
  47. - src/*/*/*.log
  48. # In this build we combine
  49. # * clang
  50. # * ASan, UBSan
  51. # * check, distcheck
  52. Sanitizers/Stretch:
  53. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  54. script:
  55. - export CFLAGS="$CFLAGS_DEFAULT -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address"
  56. - ./bootstrap
  57. - export CC="ccache clang"
  58. - export UBSAN_OPTIONS=print_stacktrace=1
  59. - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.8/bin/llvm-symbolizer
  60. - ./configure $CONFIGURE_BASE_FLAGS --disable-doc
  61. - make check
  62. - make -j$(nproc) distcheck
  63. tags:
  64. - shared
  65. artifacts:
  66. expire_in: 2 weeks
  67. when: on_failure
  68. paths:
  69. - ./*.log
  70. - src/*/*.log
  71. - src/*/*/*.log
  72. Scan-Build/Debian:
  73. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  74. script:
  75. - export CFLAGS=$CFLAGS_DEFAULT
  76. - ./bootstrap
  77. - scan-build ./configure $CONFIGURE_BASE_FLAGS
  78. - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make -j$(nproc)
  79. - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make check
  80. tags:
  81. - shared
  82. except:
  83. - tags
  84. artifacts:
  85. expire_in: 2 weeks
  86. when: on_failure
  87. paths:
  88. - scan-build/*
  89. MinGW/Debian:
  90. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
  91. script:
  92. - export CC="ccache $PREFIX-gcc"
  93. - ./bootstrap
  94. - ./configure $CONFIGURE_BASE_FLAGS --build=x86_64-pc-linux-gnu --host=$PREFIX
  95. - make -j$(nproc)
  96. dist/Stretch:
  97. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  98. script:
  99. - export CFLAGS=$CFLAGS_DEFAULT
  100. - ./bootstrap
  101. - ./configure $CONFIGURE_BASE_FLAGS
  102. - make -j$(nproc) dist
  103. tags:
  104. - shared
  105. artifacts:
  106. name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
  107. expire_in: 2 weeks
  108. when: on_success
  109. paths:
  110. - ./libmicrohttpd-*.*.*.tar.??