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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ---
  2. workspace:
  3. base: /rspamd
  4. pipeline:
  5. prepare:
  6. # ubuntu used as base image for build and test images
  7. # and we need to download it anyway
  8. image: ubuntu:18.04
  9. commands:
  10. - install -d -o nobody -g nogroup /rspamd/build /rspamd/install
  11. # lua-torch CMakeLists writes to src dir
  12. - chown nobody $CI_WORKSPACE/contrib/lua-torch/nn
  13. build:
  14. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-build/Dockerfile
  15. image: rspamd/ci-ubuntu-build
  16. group: build
  17. commands:
  18. # build directories should be writable by nobody, for rspamd in functional tests
  19. # works as nobody and writes coverage files there
  20. - test "$(id -un)" = nobody
  21. - cd /rspamd/build
  22. - cmake $CI_WORKSPACE -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF
  23. - ncpu=$(getconf _NPROCESSORS_ONLN)
  24. - make -j $ncpu install
  25. - make -j $ncpu rspamd-test
  26. eslint:
  27. image: node:10-alpine
  28. group: build
  29. commands:
  30. - npm install
  31. - ./node_modules/.bin/eslint -v
  32. - ./node_modules/.bin/eslint ./
  33. rspamd-test:
  34. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-test/Dockerfile
  35. image: rspamd/ci-ubuntu-test
  36. pull: true
  37. group: tests
  38. commands:
  39. - test "$(id -un)" = nobody
  40. - ulimit -c unlimited
  41. # rspamd-test and functional test both use luacov.stats.out file and should be started from
  42. # different directories (if started in parallel)
  43. - cd /rspamd/build/test
  44. - set +e
  45. - ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?
  46. - set -e
  47. # shell sets exit status of a process terminated by a signal to '128 + signal-number'
  48. # if rspamd-test was terminated by a signal it should be SIGSEGV or SIGABRT, try to examine core
  49. - >
  50. if [ $EXIT_CODE -gt 128 ]; then
  51. gdb -c /var/tmp/*.rspamd-test.core ./rspamd-test -ex "set pagination 0" -ex "thread apply all bt full" --batch;
  52. exit $EXIT_CODE;
  53. fi
  54. # luacov-coveralls reads luacov.stats.out written by rspamd-test using luacov module
  55. # and writes json report for coveralls.io service
  56. - luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun
  57. - cd /rspamd/build
  58. - coveralls --dump coverage.rspamd-test.dump
  59. - exit $EXIT_CODE
  60. functional:
  61. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-test-func/Dockerfile
  62. image: rspamd/ci-ubuntu-test-func
  63. pull: true
  64. group: tests
  65. commands:
  66. - cd /rspamd/build
  67. # some rspamd processes during this test work as root and some as nobody
  68. # use umask to create world-writable files so nobody can write to *.gcda files created by root
  69. - umask 0000
  70. - set +e
  71. - RSPAMD_INSTALLROOT=/rspamd/install robot --xunit xunit.xml --exclude isbroken $CI_WORKSPACE/test/functional/cases; EXIT_CODE=$?
  72. - set -e
  73. - coveralls --dump coverage.functional.dump
  74. - exit $EXIT_CODE
  75. send-coverage:
  76. image: rspamd/ci-ubuntu-test
  77. secrets: [ coveralls_repo_token ]
  78. commands:
  79. - cd /rspamd/build
  80. - $CI_WORKSPACE/test/functional/util/merge_coveralls.py --input coverage.functional.dump coverage.rspamd-test.dump unit_test_lua.json lua_coverage_report.json --output out.josn --token=$COVERALLS_REPO_TOKEN
  81. when:
  82. branch: master
  83. # don't send coverage report for pull request
  84. event: [push, tag]
  85. send-test-log:
  86. image: drillster/drone-email
  87. from: noreply@rspamd.com
  88. attachment: /rspamd/build/log.html
  89. secrets: [email_host, email_username, email_password]
  90. when:
  91. status: failure