.drone.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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:bookworm
  93. pull: always
  94. commands:
  95. - apt-get update && apt-get -yq install autoconf
  96. - ./bootstrap.sh -j
  97. - name: configure
  98. image: signalwire/freeswitch-public-base:bookworm
  99. pull: always
  100. environment:
  101. REPOTOKEN:
  102. from_secret: repotoken
  103. commands:
  104. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  105. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
  106. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
  107. - export REPOTOKEN=''
  108. - rm -rf /etc/apt/auth.conf
  109. - cp build/modules.conf.most modules.conf
  110. #Enable/Uncomment mods
  111. - echo 'codecs/mod_openh264' >> modules.conf
  112. - sed -i "/mod_mariadb/s/^#//g" modules.conf
  113. - sed -i "/mod_v8/s/^#//g" modules.conf
  114. #Disable/Comment out mods
  115. - sed -i '/mod_ilbc/s/^/#/g' modules.conf
  116. - sed -i '/mod_isac/s/^/#/g' modules.conf
  117. - sed -i '/mod_mp4/s/^/#/g' modules.conf
  118. - sed -i '/mod_mongo/s/^/#/g' modules.conf
  119. - sed -i '/mod_pocketsphinx/s/^/#/g' modules.conf
  120. - sed -i '/mod_sangoma_codec/s/^/#/g' modules.conf
  121. - sed -i '/mod_siren/s/^/#/g' modules.conf
  122. #Comment out mods for a while
  123. - sed -i '/mod_avmd/s/^/#/g' modules.conf
  124. - sed -i '/mod_basic/s/^/#/g' modules.conf
  125. - sed -i '/mod_cdr_mongodb/s/^/#/g' modules.conf
  126. - sed -i '/mod_cv/s/^/#/g' modules.conf
  127. - sed -i '/mod_erlang_event/s/^/#/g' modules.conf
  128. - sed -i '/mod_perl/s/^/#/g' modules.conf
  129. - sed -i '/mod_rtmp/s/^/#/g' modules.conf
  130. - sed -i '/mod_unimrcp/s/^/#/g' modules.conf
  131. - sed -i '/mod_xml_rpc/s/^/#/g' modules.conf
  132. - ./configure
  133. - name: scan-build
  134. image: signalwire/freeswitch-public-base:bookworm
  135. pull: always
  136. environment:
  137. REPOTOKEN:
  138. from_secret: repotoken
  139. commands:
  140. - echo "machine freeswitch.signalwire.com password $REPOTOKEN" > /etc/apt/auth.conf
  141. - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
  142. - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
  143. - export REPOTOKEN=''
  144. - rm -rf /etc/apt/auth.conf
  145. - mkdir -p scan-build
  146. - echo '#!/bin/bash\nscan-build-14 --force-analyze-debug-code -o ./scan-build/ make -j`nproc --all` |& tee ./scan-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./scan-build-status.txt\n' > scan.sh
  147. - chmod +x scan.sh
  148. - ./scan.sh
  149. - exitstatus=`cat ./scan-build-status.txt`
  150. - echo "*** Exit status is $exitstatus"
  151. - name: notify
  152. image: signalwire/drone-notify
  153. pull: always
  154. environment:
  155. SLACK_WEBHOOK_URL:
  156. from_secret: slack_webhook_url
  157. ENV_FILE:
  158. from_secret: notify_env
  159. commands:
  160. - /root/scan-build-notify.sh
  161. trigger:
  162. branch:
  163. - master
  164. event:
  165. - pull_request
  166. - push
  167. ---
  168. kind: signature
  169. hmac: 7e5f6cafc88da0be59243daf47a2a5607ff00b45f441ce4c1041d4b690e8a853
  170. ...