.drone.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ---
  2. kind: pipeline
  3. name: default
  4. steps:
  5. - name: scan-build
  6. image: debian:buster
  7. pull: always
  8. commands:
  9. - apt-get update && apt-get install -yq build-essential autotools-dev lsb-release pkg-config automake autoconf libtool-bin clang-tools-7
  10. - apt-get install -yq cmake uuid-dev libssl-dev
  11. - sed -i '/cotire/d' ./CMakeLists.txt
  12. - mkdir -p scan-build
  13. - scan-build-7 -o ./scan-build/ cmake .
  14. - echo '#!/bin/bash\nscan-build-7 -o ./scan-build/ make -j`nproc --all` |& tee ./scan-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./scan-build-status.txt\n' > scan.sh
  15. - chmod +x scan.sh
  16. - ./scan.sh
  17. - exitstatus=`cat ./scan-build-status.txt`
  18. - echo "*** Exit status is $exitstatus"
  19. - name: notify
  20. image: signalwire/drone-notify
  21. pull: always
  22. environment:
  23. SLACK_WEBHOOK_URL:
  24. from_secret: slack_webhook_url
  25. ENV_FILE:
  26. from_secret: notify_env
  27. commands:
  28. - /root/scan-build-notify.sh
  29. trigger:
  30. branch:
  31. - master
  32. - v2.0
  33. trigger:
  34. event:
  35. - pull_request
  36. - push
  37. ---
  38. kind: pipeline
  39. name: tests
  40. steps:
  41. - name: tests
  42. image: debian:buster
  43. pull: always
  44. commands:
  45. - apt-get update && apt-get install -yq build-essential autotools-dev lsb-release pkg-config automake autoconf libtool-bin clang-tools-7
  46. - apt-get install -yq cmake uuid-dev libssl-dev colorized-logs
  47. - sed -i '/cotire/d' ./CMakeLists.txt
  48. - mkdir -p scan-build
  49. - scan-build-7 -o ./scan-build/ cmake .
  50. - mkdir -p tests/unit/logs
  51. - echo '#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./build-status.txt\n' > build.sh
  52. - chmod +x build.sh
  53. - ./build.sh
  54. - echo 0 > tests/unit/run-tests-status.txt
  55. - echo '#!/bin/bash\nenv CTEST_OUTPUT_ON_FAILURE=1 make test |& tee >(ansi2html > ./tests/unit/logs/artifacts.html)\nexitstatus=$${PIPESTATUS[0]}\nexit $$exitstatus\n' > test.sh
  56. - chmod +x test.sh
  57. - ./test.sh && exit 0 || echo 'Some tests failed'
  58. - echo 1 > tests/unit/run-tests-status.txt
  59. - name: notify
  60. image: signalwire/drone-notify
  61. pull: always
  62. environment:
  63. SLACK_WEBHOOK_URL:
  64. from_secret: slack_webhook_url
  65. ENV_FILE:
  66. from_secret: notify_env
  67. commands:
  68. - /root/unit-tests-notify.sh
  69. trigger:
  70. branch:
  71. - master
  72. - v2.0
  73. trigger:
  74. event:
  75. - pull_request
  76. - push
  77. ---
  78. kind: signature
  79. hmac: 4b113f50913a06b099cd3de6183a6c8ef5937d0bbe747a571a855f19a8b0b539
  80. ...