.drone.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. ---
  2. kind: pipeline
  3. name: unit-tests
  4. steps:
  5. - name: bootstrap
  6. image: signalwire/freeswitch-public-base:bullseye
  7. pull: always
  8. commands:
  9. - cat /proc/sys/kernel/core_pattern
  10. - ./bootstrap.sh -j
  11. - name: configure
  12. image: signalwire/freeswitch-public-base:bullseye
  13. pull: always
  14. environment:
  15. REPOTOKEN:
  16. from_secret: repotoken
  17. commands:
  18. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  19. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
  20. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
  21. - export REPOTOKEN=''
  22. - rm -rf /etc/apt/auth.conf
  23. - git clone https://github.com/freeswitch/sofia-sip.git
  24. - cd sofia-sip && ./autogen.sh && ./configure.gnu && make -j`nproc` && make install && cd ..
  25. - echo 'codecs/mod_openh264' >> modules.conf
  26. - sed -i '/applications\\/mod_http_cache/s/^#//g' modules.conf
  27. - sed -i '/event_handlers\\/mod_rayo/s/^#//g' modules.conf
  28. - sed -i '/formats\\/mod_opusfile/s/^#//g' modules.conf
  29. - sed -i '/languages\\/mod_lua/s/^#//g' modules.conf
  30. - export ASAN_OPTIONS=log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
  31. - ./configure --enable-address-sanitizer --enable-fake-dlclose
  32. - name: build
  33. image: signalwire/freeswitch-public-base:bullseye
  34. pull: always
  35. environment:
  36. REPOTOKEN:
  37. from_secret: repotoken
  38. commands:
  39. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  40. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
  41. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
  42. - export REPOTOKEN=''
  43. - rm -rf /etc/apt/auth.conf
  44. - cd sofia-sip && make install && cd ..
  45. - echo '#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./build-status.txt\n' > build.sh
  46. - chmod +x build.sh
  47. - ./build.sh
  48. - name: run-tests
  49. image: signalwire/freeswitch-public-base:bullseye
  50. pull: always
  51. environment:
  52. REPOTOKEN:
  53. from_secret: repotoken
  54. commands:
  55. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  56. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
  57. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
  58. - export REPOTOKEN=''
  59. - rm -rf /etc/apt/auth.conf
  60. - cd sofia-sip && make install && cd ..
  61. - make install || true
  62. - cd tests/unit
  63. - export ASAN_OPTIONS=log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
  64. - ./run-tests.sh
  65. - ls -la /cores
  66. - mkdir logs && (mv log_run-tests_*.html logs || true) && (mv backtrace_*.txt logs || true)
  67. - echo 0 > run-tests-status.txt
  68. - ./collect-test-logs.sh && exit 0 || echo 'Some tests failed'
  69. - echo 1 > run-tests-status.txt
  70. - cd logs && ls -la
  71. - name: notify
  72. image: signalwire/drone-notify
  73. pull: always
  74. environment:
  75. SLACK_WEBHOOK_URL:
  76. from_secret: slack_webhook_url
  77. ENV_FILE:
  78. from_secret: notify_env
  79. commands:
  80. - /root/unit-tests-notify.sh
  81. trigger:
  82. branch:
  83. - master
  84. event:
  85. - pull_request
  86. - push
  87. ---
  88. kind: pipeline
  89. name: scan-build
  90. steps:
  91. - name: bootstrap
  92. image: signalwire/freeswitch-public-base:bullseye
  93. pull: always
  94. commands:
  95. - ./bootstrap.sh -j
  96. - name: configure
  97. image: signalwire/freeswitch-public-base:bullseye
  98. pull: always
  99. environment:
  100. REPOTOKEN:
  101. from_secret: repotoken
  102. commands:
  103. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  104. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
  105. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
  106. - export REPOTOKEN=''
  107. - rm -rf /etc/apt/auth.conf
  108. - cp build/modules.conf.most modules.conf
  109. #Enable/Uncomment mods
  110. - echo 'codecs/mod_openh264' >> modules.conf
  111. - sed -i "/mod_mariadb/s/^#//g" modules.conf
  112. - sed -i "/mod_v8/s/^#//g" modules.conf
  113. #Disable/Comment out mods
  114. - sed -i '/mod_ilbc/s/^/#/g' modules.conf
  115. - sed -i '/mod_isac/s/^/#/g' modules.conf
  116. - sed -i '/mod_mp4/s/^/#/g' modules.conf
  117. - sed -i '/mod_mongo/s/^/#/g' modules.conf
  118. - sed -i '/mod_pocketsphinx/s/^/#/g' modules.conf
  119. - sed -i '/mod_sangoma_codec/s/^/#/g' modules.conf
  120. - sed -i '/mod_siren/s/^/#/g' modules.conf
  121. #Comment out mods for a while
  122. - sed -i '/mod_avmd/s/^/#/g' modules.conf
  123. - sed -i '/mod_basic/s/^/#/g' modules.conf
  124. - sed -i '/mod_cdr_mongodb/s/^/#/g' modules.conf
  125. - sed -i '/mod_cv/s/^/#/g' modules.conf
  126. - sed -i '/mod_erlang_event/s/^/#/g' modules.conf
  127. - sed -i '/mod_perl/s/^/#/g' modules.conf
  128. - sed -i '/mod_rtmp/s/^/#/g' modules.conf
  129. - sed -i '/mod_unimrcp/s/^/#/g' modules.conf
  130. - sed -i '/mod_xml_rpc/s/^/#/g' modules.conf
  131. - ./configure
  132. - name: scan-build
  133. image: signalwire/freeswitch-public-base:bullseye
  134. pull: always
  135. environment:
  136. REPOTOKEN:
  137. from_secret: repotoken
  138. commands:
  139. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  140. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
  141. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
  142. - export REPOTOKEN=''
  143. - rm -rf /etc/apt/auth.conf
  144. - mkdir -p scan-build
  145. - echo '#!/bin/bash\nscan-build-11 -o ./scan-build/ make -j`nproc --all` |& tee ./scan-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./scan-build-status.txt\n' > scan.sh
  146. - chmod +x scan.sh
  147. - ./scan.sh
  148. - exitstatus=`cat ./scan-build-status.txt`
  149. - echo "*** Exit status is $exitstatus"
  150. - name: notify
  151. image: signalwire/drone-notify
  152. pull: always
  153. environment:
  154. SLACK_WEBHOOK_URL:
  155. from_secret: slack_webhook_url
  156. ENV_FILE:
  157. from_secret: notify_env
  158. commands:
  159. - /root/scan-build-notify.sh
  160. trigger:
  161. branch:
  162. - master
  163. event:
  164. - pull_request
  165. - push
  166. ---
  167. kind: signature
  168. hmac: 780e4aaee61e3683ea4a8d6fe5131f7c9e62ebad727546013f18df0fca80d705
  169. ...