.gitlab-ci.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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
  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) && make -k check
  37. tags:
  38. - shared
  39. - linux
  40. artifacts:
  41. expire_in: 2 weeks
  42. when: on_failure
  43. paths:
  44. - ./*.log
  45. - src/*/*.log
  46. - src/*/*/*.log
  47. # In this build we combine
  48. # * clang
  49. # * ASan, UBSan
  50. # * check
  51. Sanitizers/Stretch:
  52. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  53. script:
  54. - export CFLAGS="$CFLAGS_DEFAULT"
  55. - ./bootstrap
  56. - export CC="ccache clang"
  57. - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.8/bin/llvm-symbolizer
  58. - ./configure $CONFIGURE_BASE_FLAGS --disable-doc --enable-sanitizers
  59. - make -j$(nproc) && make -k check
  60. tags:
  61. - shared
  62. - linux
  63. artifacts:
  64. expire_in: 2 weeks
  65. when: on_failure
  66. paths:
  67. - ./*.log
  68. - src/*/*.log
  69. - src/*/*/*.log
  70. Scan-Build/Debian:
  71. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  72. script:
  73. - export CFLAGS="$CFLAGS_DEFAULT"
  74. - ./bootstrap
  75. - scan-build ./configure $CONFIGURE_BASE_FLAGS
  76. - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make -j$(nproc)
  77. - scan-build -v -enable-checker security,nullability --status-bugs -o scan-build make -k check
  78. tags:
  79. - shared
  80. - linux
  81. except:
  82. - tags
  83. artifacts:
  84. expire_in: 2 weeks
  85. when: on_failure
  86. paths:
  87. - scan-build/*
  88. MinGW/Debian:
  89. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$MINGW_BUILD
  90. script:
  91. - export CFLAGS="$CFLAGS_DEFAULT"
  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. tags:
  97. - shared
  98. - linux
  99. dist/Stretch:
  100. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  101. script:
  102. - export CFLAGS="$CFLAGS_DEFAULT"
  103. - ./bootstrap
  104. - ./configure $CONFIGURE_BASE_FLAGS
  105. - make -j$(nproc) dist
  106. tags:
  107. - shared
  108. - linux
  109. artifacts:
  110. name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
  111. expire_in: 2 weeks
  112. when: on_success
  113. paths:
  114. - ./libmicrohttpd-*.*.*.tar.??