Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

.drone.yml 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. ---
  2. {
  3. "kind": "pipeline",
  4. "name": "default",
  5. "platform": {
  6. "arch": "amd64",
  7. "os": "linux"
  8. },
  9. "steps": [
  10. {
  11. "commands": [
  12. "install -d -o nobody -g nogroup /rspamd/build /rspamd/install /rspamd/fedora/build /rspamd/fedora/install"
  13. ],
  14. "image": "ubuntu:22.04",
  15. "name": "prepare",
  16. "pull": "if-not-exists",
  17. "volumes": [
  18. {
  19. "name": "rspamd",
  20. "path": "/rspamd"
  21. }
  22. ]
  23. },
  24. {
  25. "commands": [
  26. "test \"$(id -un)\" = nobody",
  27. "cd /rspamd/build",
  28. "cmake -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON -GNinja $DRONE_WORKSPACE\n",
  29. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  30. "ninja -j $ncpu install",
  31. "ninja -j $ncpu rspamd-test",
  32. "ninja -j $ncpu rspamd-test-cxx"
  33. ],
  34. "depends_on": [
  35. "prepare"
  36. ],
  37. "image": "rspamd/ci:ubuntu-build",
  38. "name": "build",
  39. "pull": "always",
  40. "volumes": [
  41. {
  42. "name": "rspamd",
  43. "path": "/rspamd"
  44. }
  45. ]
  46. },
  47. {
  48. "commands": [
  49. "test \"$(id -un)\" = nobody",
  50. "cd /rspamd/fedora/build",
  51. "export LDFLAGS='-fuse-ld=lld'",
  52. "export ASAN_OPTIONS=detect_leaks=0",
  53. "cmake -DCMAKE_INSTALL_PREFIX=/rspamd/fedora/install -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_CLANG_PLUGIN=ON -DENABLE_FULL_DEBUG=ON -DENABLE_HYPERSCAN=ON -DSANITIZE=address $DRONE_WORKSPACE\n",
  54. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  55. "make -j $ncpu install",
  56. "make -j $ncpu rspamd-test",
  57. "make -j $ncpu rspamd-test-cxx"
  58. ],
  59. "depends_on": [
  60. "prepare"
  61. ],
  62. "image": "rspamd/ci:fedora-build",
  63. "name": "build-clang",
  64. "pull": "always",
  65. "volumes": [
  66. {
  67. "name": "rspamd",
  68. "path": "/rspamd"
  69. }
  70. ]
  71. },
  72. {
  73. "commands": [
  74. "test \"$(id -un)\" = nobody",
  75. "ulimit -c unlimited",
  76. "cd /rspamd/build/test",
  77. "set +e",
  78. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  79. "set -e",
  80. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'thread apply all bt full' -c /var/tmp/*.rspamd-test.core ./rspamd-test; exit $EXIT_CODE; fi; if [ $EXIT_CODE -ne 0 ]; then exit $EXIT_CODE; fi\n",
  81. "luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun",
  82. "set +e",
  83. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  84. "set -e",
  85. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'thread apply all bt full' -c /var/tmp/*.rspamd-test-cxx.core ./rspamd-test-cxx; exit $EXIT_CODE; fi\n",
  86. "exit $EXIT_CODE"
  87. ],
  88. "depends_on": [
  89. "build"
  90. ],
  91. "image": "rspamd/ci:ubuntu-test",
  92. "name": "rspamd-test",
  93. "pull": "always",
  94. "volumes": [
  95. {
  96. "name": "rspamd",
  97. "path": "/rspamd"
  98. }
  99. ]
  100. },
  101. {
  102. "commands": [
  103. "test \"$(id -un)\" = nobody",
  104. "ulimit -c 2097152",
  105. "ulimit -s unlimited",
  106. "export ASAN_OPTIONS=\"detect_leaks=0:print_stacktrace=1:disable_coredump=0\"",
  107. "export UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=0:log_path=/tmp/ubsan\"",
  108. "cd /rspamd/fedora/build/test",
  109. "set +e",
  110. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  111. "set -e",
  112. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'bt' -c /var/tmp/*.rspamd-test.core ./rspamd-test; fi\n",
  113. "set +e",
  114. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  115. "set -e",
  116. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'thread apply all bt full' -c /var/tmp/*.rspamd-test-cxx.core ./rspamd-test-cxx; exit $EXIT_CODE; fi\n",
  117. "cat /tmp/ubsan.* || true",
  118. "exit $EXIT_CODE"
  119. ],
  120. "depends_on": [
  121. "build-clang"
  122. ],
  123. "image": "rspamd/ci:fedora-test",
  124. "name": "test-fedora-clang",
  125. "pull": "always",
  126. "volumes": [
  127. {
  128. "name": "rspamd",
  129. "path": "/rspamd"
  130. }
  131. ]
  132. },
  133. {
  134. "commands": [
  135. "cd /rspamd/build",
  136. "ulimit -c unlimited",
  137. "ulimit -s unlimited",
  138. "umask 0000",
  139. "set +e",
  140. "RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $DRONE_WORKSPACE/test/functional/cases; EXIT_CODE=$?",
  141. "set -e",
  142. "if [ -n \"$HTTP_PUT_AUTH\" ]; then $DRONE_WORKSPACE/test/tools/http_put.py log.html report.html https://$DRONE_SYSTEM_HOSTNAME/testlogs/$DRONE_REPO/$DRONE_BUILD_NUMBER/; fi\n",
  143. "core_files=$(find /var/tmp/ -name '*.core')",
  144. "for core in $core_files; do exe=$(gdb --batch -ex 'info proc mappings' -c $core | tail -1 | awk '{print $5}'); gdb --batch -ex 'bt' -c $core $exe; echo '---'; done\n",
  145. "exit $EXIT_CODE"
  146. ],
  147. "depends_on": [
  148. "build"
  149. ],
  150. "environment": {
  151. "HTTP_PUT_AUTH": {
  152. "from_secret": "http_put_auth"
  153. }
  154. },
  155. "image": "rspamd/ci:ubuntu-test-func",
  156. "name": "functional",
  157. "pull": "always",
  158. "volumes": [
  159. {
  160. "name": "rspamd",
  161. "path": "/rspamd"
  162. }
  163. ]
  164. },
  165. {
  166. "commands": [
  167. "cd /rspamd/build",
  168. "$DRONE_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $DRONE_WORKSPACE --out coverage.c.json",
  169. "luacov-coveralls -o coverage.functional.lua.json --dryrun",
  170. "$DRONE_WORKSPACE/test/tools/merge_coveralls.py --root $DRONE_WORKSPACE --input coverage.c.json unit_test_lua.json coverage.functional.lua.json --token=$COVERALLS_REPO_TOKEN"
  171. ],
  172. "depends_on": [
  173. "functional",
  174. "rspamd-test"
  175. ],
  176. "environment": {
  177. "COVERALLS_REPO_TOKEN": {
  178. "from_secret": "coveralls_repo_token"
  179. }
  180. },
  181. "image": "rspamd/ci:ubuntu-test",
  182. "name": "send-coverage",
  183. "pull": "if-not-exists",
  184. "volumes": [
  185. {
  186. "name": "rspamd",
  187. "path": "/rspamd"
  188. }
  189. ],
  190. "when": {
  191. "branch": [
  192. "master"
  193. ],
  194. "event": [
  195. "push",
  196. "tag"
  197. ]
  198. }
  199. },
  200. {
  201. "commands": [
  202. "npm install",
  203. "./node_modules/.bin/eslint -v",
  204. "./node_modules/.bin/eslint ./",
  205. "./node_modules/.bin/stylelint -v",
  206. "npm show stylelint-config-standard version",
  207. "./node_modules/.bin/stylelint ./**/*.css ./**/*.html ./**/*.js"
  208. ],
  209. "failure": "ignore",
  210. "image": "node:18-alpine",
  211. "name": "eslint",
  212. "pull": "if-not-exists"
  213. },
  214. {
  215. "commands": [
  216. "tidyall --version",
  217. "perltidy --version | head -1",
  218. "tidyall --all --check-only --no-cache --data-dir /tmp/tidyall"
  219. ],
  220. "failure": "ignore",
  221. "image": "rspamd/ci:perl-tidyall",
  222. "name": "perl-tidyall",
  223. "pull": "if-not-exists"
  224. },
  225. {
  226. "depends_on": [
  227. "rspamd-test",
  228. "test-fedora-clang",
  229. "functional",
  230. "send-coverage",
  231. "eslint",
  232. "perl-tidyall"
  233. ],
  234. "image": "drillster/drone-email",
  235. "name": "notify",
  236. "pull": "if-not-exists",
  237. "settings": {
  238. "from": "noreply@rspamd.com",
  239. "host": {
  240. "from_secret": "email_host"
  241. },
  242. "password": {
  243. "from_secret": "email_password"
  244. },
  245. "username": {
  246. "from_secret": "email_username"
  247. }
  248. },
  249. "when": {
  250. "status": [
  251. "failure"
  252. ]
  253. }
  254. }
  255. ],
  256. "trigger": {
  257. "event": [
  258. "push",
  259. "tag",
  260. "pull_request",
  261. "custom"
  262. ]
  263. },
  264. "type": "docker",
  265. "volumes": [
  266. {
  267. "name": "rspamd",
  268. "temp": { }
  269. }
  270. ]
  271. }
  272. ---
  273. {
  274. "hmac": "0000000000000000000000000000000000000000000000000000000000000000",
  275. "kind": "signature"
  276. }
  277. ...