.gitlab-ci.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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: --cache-file cache/config.cache
  26. CFLAGS_DEFAULT: ""
  27. # In this build we combine
  28. # * gcc
  29. # * check
  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 --enable-build-type=debug --disable-sanitizers
  36. - make -j$(nproc) && make check
  37. artifacts:
  38. expire_in: 2 weeks
  39. when: on_failure
  40. paths:
  41. - ./*.log
  42. - src/*/*.log
  43. - src/*/*/*.log
  44. # In this build we combine
  45. # * clang
  46. # * ASan, UBSan
  47. # * check
  48. Sanitizers/Stretch:
  49. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  50. script:
  51. - export CFLAGS="$CFLAGS_DEFAULT"
  52. - ./bootstrap
  53. - export CC="ccache clang"
  54. - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.8/bin/llvm-symbolizer
  55. - ./configure $CONFIGURE_BASE_FLAGS --disable-doc --enable-build-type=debug --enable-sanitizers
  56. - make -j$(nproc) && make check
  57. artifacts:
  58. expire_in: 2 weeks
  59. when: on_failure
  60. paths:
  61. - ./*.log
  62. - src/*/*.log
  63. - src/*/*/*.log
  64. Scan-Build/Debian:
  65. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  66. script:
  67. - export CFLAGS="$CFLAGS_DEFAULT"
  68. - ln -s "$(which ccache)" "$(pwd)/clang-3.8"
  69. - export CC="$(pwd)/clang-3.8"
  70. - ./bootstrap
  71. - ./configure $CONFIGURE_BASE_FLAGS --enable-build-type=debug --disable-sanitizers
  72. - (cd src/include/ && make) # options-generator is badly broken
  73. - scan-build --use-cc="$CC" -v -enable-checker security,nullability --status-bugs -o scan-build make -j$(nproc)
  74. - scan-build --use-cc="$CC" -v -enable-checker security,nullability --status-bugs -o scan-build make -k check
  75. except:
  76. - tags
  77. artifacts:
  78. expire_in: 2 weeks
  79. when: on_failure
  80. paths:
  81. - scan-build/*
  82. # ! Cross-compiling is broken currently due to options-generator
  83. #MinGW/Debian:
  84. # image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
  85. # script:
  86. # - export CFLAGS="$CFLAGS_DEFAULT"
  87. # - export CC="ccache $PREFIX-gcc"
  88. # - ./bootstrap
  89. # - ./configure $CONFIGURE_BASE_FLAGS --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-build-type=release
  90. # - make -j$(nproc)
  91. dist/Stretch:
  92. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  93. script:
  94. - export CFLAGS="$CFLAGS_DEFAULT"
  95. - ./bootstrap
  96. - ./configure $CONFIGURE_BASE_FLAGS --enable-build-type=release
  97. - make -j$(nproc) dist
  98. artifacts:
  99. name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
  100. expire_in: 2 weeks
  101. when: on_success
  102. paths:
  103. - ./libmicrohttpd-*.*.*.tar.??