選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

.drone.yml 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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. "umask 0000",
  140. "set +e",
  141. "RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $DRONE_WORKSPACE/test/functional/cases; EXIT_CODE=$?",
  142. "set -e",
  143. "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",
  144. "core_files=$(find /var/tmp/ -name '*.core')",
  145. "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",
  146. "exit $EXIT_CODE"
  147. ],
  148. "depends_on": [
  149. "build"
  150. ],
  151. "environment": {
  152. "HTTP_PUT_AUTH": {
  153. "from_secret": "http_put_auth"
  154. }
  155. },
  156. "image": "rspamd/ci:ubuntu-test-func",
  157. "name": "functional",
  158. "pull": "always",
  159. "volumes": [
  160. {
  161. "name": "rspamd",
  162. "path": "/rspamd"
  163. }
  164. ]
  165. },
  166. {
  167. "commands": [
  168. "cd /rspamd/build",
  169. "$DRONE_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $DRONE_WORKSPACE --out coverage.c.json",
  170. "luacov-coveralls -o coverage.functional.lua.json --dryrun",
  171. "$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"
  172. ],
  173. "depends_on": [
  174. "functional",
  175. "rspamd-test"
  176. ],
  177. "environment": {
  178. "COVERALLS_REPO_TOKEN": {
  179. "from_secret": "coveralls_repo_token"
  180. }
  181. },
  182. "image": "rspamd/ci:ubuntu-test",
  183. "name": "send-coverage",
  184. "pull": "if-not-exists",
  185. "volumes": [
  186. {
  187. "name": "rspamd",
  188. "path": "/rspamd"
  189. }
  190. ],
  191. "when": {
  192. "branch": [
  193. "master"
  194. ],
  195. "event": [
  196. "push",
  197. "tag"
  198. ]
  199. }
  200. }
  201. ],
  202. "trigger": {
  203. "event": [
  204. "push",
  205. "tag",
  206. "custom",
  207. "pull_request"
  208. ]
  209. },
  210. "type": "docker",
  211. "volumes": [
  212. {
  213. "name": "rspamd",
  214. "temp": { }
  215. }
  216. ]
  217. }
  218. ---
  219. {
  220. "depends_on": [ ],
  221. "kind": "pipeline",
  222. "name": "default-arm64",
  223. "platform": {
  224. "arch": "arm64",
  225. "os": "linux"
  226. },
  227. "steps": [
  228. {
  229. "commands": [
  230. "install -d -o nobody -g nogroup /rspamd/build /rspamd/install /rspamd/fedora/build /rspamd/fedora/install"
  231. ],
  232. "image": "ubuntu:22.04",
  233. "name": "prepare",
  234. "pull": "if-not-exists",
  235. "volumes": [
  236. {
  237. "name": "rspamd",
  238. "path": "/rspamd"
  239. }
  240. ]
  241. },
  242. {
  243. "commands": [
  244. "test \"$(id -un)\" = nobody",
  245. "cd /rspamd/build",
  246. "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",
  247. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  248. "ninja -j $ncpu install",
  249. "ninja -j $ncpu rspamd-test",
  250. "ninja -j $ncpu rspamd-test-cxx"
  251. ],
  252. "depends_on": [
  253. "prepare"
  254. ],
  255. "image": "rspamd/ci:ubuntu-build",
  256. "name": "build",
  257. "pull": "always",
  258. "volumes": [
  259. {
  260. "name": "rspamd",
  261. "path": "/rspamd"
  262. }
  263. ]
  264. },
  265. {
  266. "commands": [
  267. "test \"$(id -un)\" = nobody",
  268. "cd /rspamd/fedora/build",
  269. "export LDFLAGS='-fuse-ld=lld'",
  270. "export ASAN_OPTIONS=detect_leaks=0",
  271. "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",
  272. "ncpu=$(getconf _NPROCESSORS_ONLN)",
  273. "make -j $ncpu install",
  274. "make -j $ncpu rspamd-test",
  275. "make -j $ncpu rspamd-test-cxx"
  276. ],
  277. "depends_on": [
  278. "prepare"
  279. ],
  280. "image": "rspamd/ci:fedora-build",
  281. "name": "build-clang",
  282. "pull": "always",
  283. "volumes": [
  284. {
  285. "name": "rspamd",
  286. "path": "/rspamd"
  287. }
  288. ]
  289. },
  290. {
  291. "commands": [
  292. "test \"$(id -un)\" = nobody",
  293. "ulimit -c unlimited",
  294. "cd /rspamd/build/test",
  295. "set +e",
  296. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  297. "set -e",
  298. "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",
  299. "luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun",
  300. "set +e",
  301. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  302. "set -e",
  303. "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",
  304. "exit $EXIT_CODE"
  305. ],
  306. "depends_on": [
  307. "build"
  308. ],
  309. "image": "rspamd/ci:ubuntu-test",
  310. "name": "rspamd-test",
  311. "pull": "always",
  312. "volumes": [
  313. {
  314. "name": "rspamd",
  315. "path": "/rspamd"
  316. }
  317. ]
  318. },
  319. {
  320. "commands": [
  321. "test \"$(id -un)\" = nobody",
  322. "ulimit -c 2097152",
  323. "ulimit -s unlimited",
  324. "export ASAN_OPTIONS=\"detect_leaks=0:print_stacktrace=1:disable_coredump=0\"",
  325. "export UBSAN_OPTIONS=\"print_stacktrace=1:print_summary=0:log_path=/tmp/ubsan\"",
  326. "cd /rspamd/fedora/build/test",
  327. "set +e",
  328. "env RSPAMD_LUA_EXPENSIVE_TESTS=1 ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?",
  329. "set -e",
  330. "if [ $EXIT_CODE -gt 128 ]; then gdb --batch -ex 'bt' -c /var/tmp/*.rspamd-test.core ./rspamd-test; fi\n",
  331. "set +e",
  332. "./rspamd-test-cxx -s; EXIT_CODE=$?",
  333. "set -e",
  334. "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",
  335. "cat /tmp/ubsan.* || true",
  336. "exit $EXIT_CODE"
  337. ],
  338. "depends_on": [
  339. "build-clang"
  340. ],
  341. "image": "rspamd/ci:fedora-test",
  342. "name": "test-fedora-clang",
  343. "pull": "always",
  344. "volumes": [
  345. {
  346. "name": "rspamd",
  347. "path": "/rspamd"
  348. }
  349. ]
  350. },
  351. {
  352. "commands": [
  353. "cd /rspamd/build",
  354. "ulimit -c unlimited",
  355. "ulimit -s unlimited",
  356. "umask 0000",
  357. "set +e",
  358. "RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $DRONE_WORKSPACE/test/functional/cases; EXIT_CODE=$?",
  359. "set -e",
  360. "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",
  361. "core_files=$(find /var/tmp/ -name '*.core')",
  362. "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",
  363. "exit $EXIT_CODE"
  364. ],
  365. "depends_on": [
  366. "build"
  367. ],
  368. "environment": {
  369. "HTTP_PUT_AUTH": {
  370. "from_secret": "http_put_auth"
  371. }
  372. },
  373. "image": "rspamd/ci:ubuntu-test-func",
  374. "name": "functional",
  375. "pull": "always",
  376. "volumes": [
  377. {
  378. "name": "rspamd",
  379. "path": "/rspamd"
  380. }
  381. ]
  382. },
  383. {
  384. "commands": [
  385. "cd /rspamd/build",
  386. "$DRONE_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $DRONE_WORKSPACE --out coverage.c.json",
  387. "luacov-coveralls -o coverage.functional.lua.json --dryrun",
  388. "$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"
  389. ],
  390. "depends_on": [
  391. "functional",
  392. "rspamd-test"
  393. ],
  394. "environment": {
  395. "COVERALLS_REPO_TOKEN": {
  396. "from_secret": "coveralls_repo_token"
  397. }
  398. },
  399. "image": "rspamd/ci:ubuntu-test",
  400. "name": "send-coverage",
  401. "pull": "if-not-exists",
  402. "volumes": [
  403. {
  404. "name": "rspamd",
  405. "path": "/rspamd"
  406. }
  407. ],
  408. "when": {
  409. "branch": [
  410. "master"
  411. ],
  412. "event": [
  413. "push",
  414. "tag"
  415. ]
  416. }
  417. }
  418. ],
  419. "trigger": {
  420. "event": [
  421. "push",
  422. "tag",
  423. "custom",
  424. "pull_request"
  425. ]
  426. },
  427. "type": "docker",
  428. "volumes": [
  429. {
  430. "name": "rspamd",
  431. "temp": { }
  432. }
  433. ]
  434. }
  435. ---
  436. {
  437. "depends_on": [
  438. "default-amd64",
  439. "default-arm64"
  440. ],
  441. "kind": "pipeline",
  442. "name": "close_coveralls",
  443. "steps": [
  444. {
  445. "commands": [
  446. "$DRONE_WORKSPACE/test/tools/merge_coveralls.py --parallel-close --token=$COVERALLS_REPO_TOKEN"
  447. ],
  448. "environment": {
  449. "COVERALLS_REPO_TOKEN": {
  450. "from_secret": "coveralls_repo_token"
  451. }
  452. },
  453. "image": "rspamd/ci:ubuntu-test-func",
  454. "name": "close_coveralls",
  455. "pull": "always"
  456. }
  457. ],
  458. "trigger": {
  459. "branch": [
  460. "master"
  461. ],
  462. "event": [
  463. "push",
  464. "tag"
  465. ],
  466. "status": [
  467. "success",
  468. "failure"
  469. ]
  470. },
  471. "type": "docker"
  472. }
  473. ---
  474. {
  475. "kind": "pipeline",
  476. "name": "default-noarch",
  477. "steps": [
  478. {
  479. "commands": [
  480. "tidyall --version",
  481. "perltidy --version | head -1",
  482. "tidyall --all --check-only --no-cache --data-dir /tmp/tidyall"
  483. ],
  484. "failure": "ignore",
  485. "image": "rspamd/ci:perl-tidyall",
  486. "name": "perl-tidyall",
  487. "pull": "if-not-exists"
  488. },
  489. {
  490. "commands": [
  491. "npm install",
  492. "./node_modules/.bin/eslint -v",
  493. "./node_modules/.bin/eslint ./",
  494. "./node_modules/.bin/stylelint -v",
  495. "npm show stylelint-config-standard version",
  496. "./node_modules/.bin/stylelint ./**/*.css ./**/*.html ./**/*.js"
  497. ],
  498. "failure": "ignore",
  499. "image": "node:18-alpine",
  500. "name": "eslint",
  501. "pull": "if-not-exists"
  502. },
  503. {
  504. "commands": [
  505. "luacheck -q --no-color ."
  506. ],
  507. "image": "pipelinecomponents/luacheck",
  508. "name": "luacheck",
  509. "pull": "if-not-exists"
  510. }
  511. ],
  512. "trigger": {
  513. "event": [
  514. "push",
  515. "tag",
  516. "custom",
  517. "pull_request"
  518. ]
  519. },
  520. "type": "docker"
  521. }
  522. ---
  523. {
  524. "depends_on": [
  525. "default-amd64",
  526. "default-arm64",
  527. "default-noarch"
  528. ],
  529. "kind": "pipeline",
  530. "name": "notify",
  531. "steps": [
  532. {
  533. "image": "drillster/drone-email",
  534. "name": "notify",
  535. "pull": "if-not-exists",
  536. "settings": {
  537. "from": "noreply@rspamd.com",
  538. "host": {
  539. "from_secret": "email_host"
  540. },
  541. "password": {
  542. "from_secret": "email_password"
  543. },
  544. "username": {
  545. "from_secret": "email_username"
  546. }
  547. }
  548. }
  549. ],
  550. "trigger": {
  551. "event": [
  552. "push",
  553. "tag",
  554. "custom"
  555. ],
  556. "status": [
  557. "failure"
  558. ]
  559. },
  560. "type": "docker"
  561. }
  562. ---
  563. {
  564. "hmac": "6c89d1423ccbddbfac9e2b67f24192018670209a293cfee308880a16a2f2b372",
  565. "kind": "signature"
  566. }
  567. ...