.gitlab-ci.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. 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-build-type=debug --enable-sanitizers
  59. - make -j$(nproc) && make 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. - export CC="clang-3.8"
  75. - ./bootstrap
  76. - scan-build --use-cc=clang-3.8 ./configure $CONFIGURE_BASE_FLAGS --enable-build-type=debug --disable-sanitizers
  77. - scan-build --use-cc="ccache clang-3.8" -v -enable-checker security,nullability --status-bugs -o scan-build make -j$(nproc)
  78. - scan-build --use-cc="ccache clang-3.8" -v -enable-checker security,nullability --status-bugs -o scan-build make -k check
  79. tags:
  80. - shared
  81. - linux
  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 CFLAGS="$CFLAGS_DEFAULT"
  93. - export CC="ccache $PREFIX-gcc"
  94. - ./bootstrap
  95. - ./configure $CONFIGURE_BASE_FLAGS --build=x86_64-pc-linux-gnu --host=$PREFIX --enable-build-type=release
  96. - make -j$(nproc)
  97. tags:
  98. - shared
  99. - linux
  100. dist/Stretch:
  101. image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_BUILD
  102. script:
  103. - export CFLAGS="$CFLAGS_DEFAULT"
  104. - ./bootstrap
  105. - ./configure $CONFIGURE_BASE_FLAGS --enable-build-type=release
  106. - make -j$(nproc) dist
  107. tags:
  108. - shared
  109. - linux
  110. artifacts:
  111. name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
  112. expire_in: 2 weeks
  113. when: on_success
  114. paths:
  115. - ./libmicrohttpd-*.*.*.tar.??