You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. ---
  2. {
  3. "depends_on": [ ],
  4. "kind": "pipeline",
  5. "name": "default-amd64",
  6. "platform": {
  7. "arch": "amd64",
  8. "os": "linux"
  9. },
  10. "steps": [
  11. {
  12. "commands": [
  13. "install -d -o nobody -g nogroup /rspamd/build /rspamd/install /rspamd/fedora/build /rspamd/fedora/install"
  14. ],
  15. "image": "ubuntu:22.04",
  16. "name": "prepare",
  17. "pull": "if-not-exists",
  18. "volumes": [
  19. {
  20. "name": "rspamd",
  21. "path": "/rspamd"
  22. }
  23. ]
  24. },
  25. {
  26. "commands": [
  27. "test \"$(id -un)\" = nobody",
  28. "cd /rspamd/build",
  29. "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",
  30. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  31. "ninja -j $ncpu install",
  32. "ninja -j $ncpu rspamd-test",
  33. "ninja -j $ncpu rspamd-test-cxx"
  34. ],
  35. "depends_on": [
  36. "prepare"
  37. ],
  38. "image": "rspamd/ci:ubuntu-build",
  39. "name": "build",
  40. "pull": "always",
  41. "volumes": [
  42. {
  43. "name": "rspamd",
  44. "path": "/rspamd"
  45. }
  46. ]
  47. },
  48. {
  49. "commands": [
  50. "test \"$(id -un)\" = nobody",
  51. "cd /rspamd/fedora/build",
  52. "export LDFLAGS='-fuse-ld=lld'",
  53. "export ASAN_OPTIONS=detect_leaks=0",
  54. "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",
  55. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  56. "make -j $ncpu install",
  57. "make -j $ncpu rspamd-test",
  58. "make -j $ncpu rspamd-test-cxx"
  59. ],
  60. "depends_on": [
  61. "prepare"
  62. ],
  63. "image": "rspamd/ci:fedora-build",
  64. "name": "build-clang",
  65. "pull": "always",
  66. "volumes": [
  67. {
  68. "name": "rspamd",
  69. "path": "/rspamd"
  70. }
  71. ]
  72. },
  73. {
  74. "commands": [
  75. "test \"$(id -un)\" = nobody",
  76. "ulimit -c unlimited",
  77. "cd /rspamd/build/test",
  78. "set +e",
  79. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  80. "set -e",
  81. "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",
  82. "luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun",
  83. "set +e",
  84. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  85. "set -e",
  86. "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",
  87. "exit $EXIT_CODE"
  88. ],
  89. "depends_on": [
  90. "build"
  91. ],
  92. "image": "rspamd/ci:ubuntu-test",
  93. "name": "rspamd-test",
  94. "pull": "always",
  95. "volumes": [
  96. {
  97. "name": "rspamd",
  98. "path": "/rspamd"
  99. }
  100. ]
  101. },
  102. {
  103. "commands": [
  104. "test \"$(id -un)\" = nobody",
  105. "ulimit -c 2097152",
  106. "ulimit -s unlimited",
  107. "export ASAN_OPTIONS=\"detect_leaks=0:print_stacktrace=1:disable_coredump=0\"",
  108. "export UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=0:log_path=/tmp/ubsan\"",
  109. "cd /rspamd/fedora/build/test",
  110. "set +e",
  111. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  112. "set -e",
  113. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'bt' -c /var/tmp/*.rspamd-test.core ./rspamd-test; fi\n",
  114. "set +e",
  115. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  116. "set -e",
  117. "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",
  118. "cat /tmp/ubsan.* || true",
  119. "exit $EXIT_CODE"
  120. ],
  121. "depends_on": [
  122. "build-clang"
  123. ],
  124. "image": "rspamd/ci:fedora-test",
  125. "name": "test-fedora-clang",
  126. "pull": "always",
  127. "volumes": [
  128. {
  129. "name": "rspamd",
  130. "path": "/rspamd"
  131. }
  132. ]
  133. },
  134. {
  135. "commands": [
  136. "cd /rspamd/build",
  137. "ulimit -c unlimited",
  138. "ulimit -s unlimited",
  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}-amd64/; 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 --parallel --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. "trigger": {
  202. "event": [
  203. "push",
  204. "tag",
  205. "custom",
  206. "pull_request"
  207. ]
  208. },
  209. "type": "docker",
  210. "volumes": [
  211. {
  212. "name": "rspamd",
  213. "temp": { }
  214. }
  215. ]
  216. }
  217. ---
  218. {
  219. "depends_on": [ ],
  220. "kind": "pipeline",
  221. "name": "default-arm64",
  222. "platform": {
  223. "arch": "arm64",
  224. "os": "linux"
  225. },
  226. "steps": [
  227. {
  228. "commands": [
  229. "install -d -o nobody -g nogroup /rspamd/build /rspamd/install /rspamd/fedora/build /rspamd/fedora/install"
  230. ],
  231. "image": "ubuntu:22.04",
  232. "name": "prepare",
  233. "pull": "if-not-exists",
  234. "volumes": [
  235. {
  236. "name": "rspamd",
  237. "path": "/rspamd"
  238. }
  239. ]
  240. },
  241. {
  242. "commands": [
  243. "test \"$(id -un)\" = nobody",
  244. "cd /rspamd/build",
  245. "cmake -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON -DHYPERSCAN_ROOT_DIR=/vectorscan -GNinja $DRONE_WORKSPACE\n",
  246. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  247. "ninja -j $ncpu install",
  248. "ninja -j $ncpu rspamd-test",
  249. "ninja -j $ncpu rspamd-test-cxx"
  250. ],
  251. "depends_on": [
  252. "prepare"
  253. ],
  254. "image": "rspamd/ci:ubuntu-build",
  255. "name": "build",
  256. "pull": "always",
  257. "volumes": [
  258. {
  259. "name": "rspamd",
  260. "path": "/rspamd"
  261. }
  262. ]
  263. },
  264. {
  265. "commands": [
  266. "test \"$(id -un)\" = nobody",
  267. "cd /rspamd/fedora/build",
  268. "export LDFLAGS='-fuse-ld=lld'",
  269. "export ASAN_OPTIONS=detect_leaks=0",
  270. "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 -DHYPERSCAN_ROOT_DIR=/vectorscan -DSANITIZE=address $DRONE_WORKSPACE\n",
  271. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  272. "make -j $ncpu install",
  273. "make -j $ncpu rspamd-test",
  274. "make -j $ncpu rspamd-test-cxx"
  275. ],
  276. "depends_on": [
  277. "prepare"
  278. ],
  279. "image": "rspamd/ci:fedora-build",
  280. "name": "build-clang",
  281. "pull": "always",
  282. "volumes": [
  283. {
  284. "name": "rspamd",
  285. "path": "/rspamd"
  286. }
  287. ]
  288. },
  289. {
  290. "commands": [
  291. "test \"$(id -un)\" = nobody",
  292. "ulimit -c unlimited",
  293. "cd /rspamd/build/test",
  294. "set +e",
  295. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  296. "set -e",
  297. "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",
  298. "luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun",
  299. "set +e",
  300. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  301. "set -e",
  302. "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",
  303. "exit $EXIT_CODE"
  304. ],
  305. "depends_on": [
  306. "build"
  307. ],
  308. "image": "rspamd/ci:ubuntu-test",
  309. "name": "rspamd-test",
  310. "pull": "always",
  311. "volumes": [
  312. {
  313. "name": "rspamd",
  314. "path": "/rspamd"
  315. }
  316. ]
  317. },
  318. {
  319. "commands": [
  320. "test \"$(id -un)\" = nobody",
  321. "ulimit -c 2097152",
  322. "ulimit -s unlimited",
  323. "export ASAN_OPTIONS=\"detect_leaks=0:print_stacktrace=1:disable_coredump=0\"",
  324. "export UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=0:log_path=/tmp/ubsan\"",
  325. "cd /rspamd/fedora/build/test",
  326. "set +e",
  327. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  328. "set -e",
  329. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'bt' -c /var/tmp/*.rspamd-test.core ./rspamd-test; fi\n",
  330. "set +e",
  331. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  332. "set -e",
  333. "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",
  334. "cat /tmp/ubsan.* || true",
  335. "exit $EXIT_CODE"
  336. ],
  337. "depends_on": [
  338. "build-clang"
  339. ],
  340. "image": "rspamd/ci:fedora-test",
  341. "name": "test-fedora-clang",
  342. "pull": "always",
  343. "volumes": [
  344. {
  345. "name": "rspamd",
  346. "path": "/rspamd"
  347. }
  348. ]
  349. },
  350. {
  351. "commands": [
  352. "cd /rspamd/build",
  353. "ulimit -c unlimited",
  354. "ulimit -s unlimited",
  355. "set +e",
  356. "RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $DRONE_WORKSPACE/test/functional/cases; EXIT_CODE=$?",
  357. "set -e",
  358. "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}-arm64/; fi\n",
  359. "core_files=$(find /var/tmp/ -name '*.core')",
  360. "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",
  361. "exit $EXIT_CODE"
  362. ],
  363. "depends_on": [
  364. "build"
  365. ],
  366. "environment": {
  367. "HTTP_PUT_AUTH": {
  368. "from_secret": "http_put_auth"
  369. }
  370. },
  371. "image": "rspamd/ci:ubuntu-test-func",
  372. "name": "functional",
  373. "pull": "always",
  374. "volumes": [
  375. {
  376. "name": "rspamd",
  377. "path": "/rspamd"
  378. }
  379. ]
  380. },
  381. {
  382. "commands": [
  383. "cd /rspamd/build",
  384. "$DRONE_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $DRONE_WORKSPACE --out coverage.c.json",
  385. "luacov-coveralls -o coverage.functional.lua.json --dryrun",
  386. "$DRONE_WORKSPACE/test/tools/merge_coveralls.py --parallel --root $DRONE_WORKSPACE --input coverage.c.json unit_test_lua.json coverage.functional.lua.json --token=$COVERALLS_REPO_TOKEN"
  387. ],
  388. "depends_on": [
  389. "functional",
  390. "rspamd-test"
  391. ],
  392. "environment": {
  393. "COVERALLS_REPO_TOKEN": {
  394. "from_secret": "coveralls_repo_token"
  395. }
  396. },
  397. "image": "rspamd/ci:ubuntu-test",
  398. "name": "send-coverage",
  399. "pull": "if-not-exists",
  400. "volumes": [
  401. {
  402. "name": "rspamd",
  403. "path": "/rspamd"
  404. }
  405. ],
  406. "when": {
  407. "branch": [
  408. "master"
  409. ],
  410. "event": [
  411. "push",
  412. "tag"
  413. ]
  414. }
  415. }
  416. ],
  417. "trigger": {
  418. "event": [
  419. "push",
  420. "tag",
  421. "custom",
  422. "pull_request"
  423. ]
  424. },
  425. "type": "docker",
  426. "volumes": [
  427. {
  428. "name": "rspamd",
  429. "temp": { }
  430. }
  431. ]
  432. }
  433. ---
  434. {
  435. "depends_on": [
  436. "default-amd64",
  437. "default-arm64"
  438. ],
  439. "kind": "pipeline",
  440. "name": "close_coveralls",
  441. "steps": [
  442. {
  443. "commands": [
  444. "$DRONE_WORKSPACE/test/tools/merge_coveralls.py --parallel-close --token=$COVERALLS_REPO_TOKEN"
  445. ],
  446. "environment": {
  447. "COVERALLS_REPO_TOKEN": {
  448. "from_secret": "coveralls_repo_token"
  449. }
  450. },
  451. "image": "rspamd/ci:ubuntu-test-func",
  452. "name": "close_coveralls",
  453. "pull": "always"
  454. }
  455. ],
  456. "trigger": {
  457. "branch": [
  458. "master"
  459. ],
  460. "event": [
  461. "push",
  462. "tag"
  463. ],
  464. "status": [
  465. "success",
  466. "failure"
  467. ]
  468. },
  469. "type": "docker"
  470. }
  471. ---
  472. {
  473. "kind": "pipeline",
  474. "name": "default-noarch",
  475. "steps": [
  476. {
  477. "commands": [
  478. "tidyall --version",
  479. "perltidy --version | head -1",
  480. "tidyall --all --check-only --no-cache --data-dir /tmp/tidyall"
  481. ],
  482. "failure": "ignore",
  483. "image": "rspamd/ci:perl-tidyall",
  484. "name": "perl-tidyall",
  485. "pull": "if-not-exists"
  486. },
  487. {
  488. "commands": [
  489. "npm install",
  490. "npm ls",
  491. "./node_modules/.bin/eslint ./",
  492. "./node_modules/.bin/stylelint ./**/*.css ./**/*.html ./**/*.js"
  493. ],
  494. "failure": "ignore",
  495. "image": "node:18-alpine",
  496. "name": "eslint",
  497. "pull": "if-not-exists"
  498. },
  499. {
  500. "commands": [
  501. "luacheck -q --no-color ."
  502. ],
  503. "image": "pipelinecomponents/luacheck",
  504. "name": "luacheck",
  505. "pull": "if-not-exists"
  506. }
  507. ],
  508. "trigger": {
  509. "event": [
  510. "push",
  511. "tag",
  512. "custom",
  513. "pull_request"
  514. ]
  515. },
  516. "type": "docker"
  517. }
  518. ---
  519. {
  520. "depends_on": [
  521. "default-amd64",
  522. "default-arm64",
  523. "default-noarch"
  524. ],
  525. "kind": "pipeline",
  526. "name": "notify",
  527. "steps": [
  528. {
  529. "image": "drillster/drone-email",
  530. "name": "notify",
  531. "pull": "if-not-exists",
  532. "settings": {
  533. "from": "noreply@rspamd.com",
  534. "host": {
  535. "from_secret": "email_host"
  536. },
  537. "password": {
  538. "from_secret": "email_password"
  539. },
  540. "username": {
  541. "from_secret": "email_username"
  542. }
  543. }
  544. }
  545. ],
  546. "trigger": {
  547. "event": [
  548. "push",
  549. "tag",
  550. "custom"
  551. ],
  552. "status": [
  553. "failure"
  554. ]
  555. },
  556. "type": "docker"
  557. }
  558. ---
  559. {
  560. "hmac": "2351718d9a562ea71ff344fb39fcf4ad5dae5b9694219b933c1b63a8b87d2aa5",
  561. "kind": "signature"
  562. }
  563. ...