From 9a94c3d5a73fbd182e03bb29612ae778f1be9032 Mon Sep 17 00:00:00 2001
From: Andrey Volk <andywolk@gmail.com>
Date: Thu, 11 Jun 2020 17:26:50 +0400
Subject: [PATCH] [Tests] Split drone build and run-tests.

---
 .drone.yml | 48 ++++++++++++++++++++++++++++++++++--------------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 0dc1cde12d..2dd901b34e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -2,16 +2,18 @@
 kind: pipeline
 name: unit-tests
 
-node:
-  freeswitch: public
-
 steps:
-    - name: run-tests
+    - name: bootstrap
       image: signalwire/freeswitch-public-base
       pull: true
       commands:
       - cat /proc/sys/kernel/core_pattern
       - ./bootstrap.sh -j
+
+    - name: configure
+      image: signalwire/freeswitch-public-base
+      pull: true
+      commands:
       - echo "applications/mod_test" >> modules.conf
       - echo 'codecs/mod_openh264' >> modules.conf
       - sed -i '/applications\\/mod_http_cache/s/^#//g' modules.conf
@@ -20,9 +22,20 @@ steps:
       - sed -i '/languages\\/mod_lua/s/^#//g' modules.conf
       - export ASAN_OPTIONS=log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1;
       - ./configure --enable-address-sanitizer
-      - echo '#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./build-status.txt\nmake install\n' > build.sh
+
+    - name: build
+      image: signalwire/freeswitch-public-base
+      pull: true
+      commands:
+      - echo '#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./build-status.txt\n' > build.sh
       - chmod +x build.sh
       - ./build.sh
+
+    - name: run-tests
+      image: signalwire/freeswitch-public-base
+      pull: true
+      commands:
+      - make install || true
       - cd tests/unit
       - ./run-tests.sh
       - ls -la /cores
@@ -33,13 +46,13 @@ steps:
       - cd logs && ls -la
 
     - name: notify
-      image: signalwire/unit-tests-notify
+      image: signalwire/public-unit-tests-notify
       pull: true
       environment:
         GITHUB_CI_APP_PEM:
           from_secret: github_ci_app_pem
         SSH_KEY:
-          from_secret: ssh_key
+          from_secret: public_artifacts_ssh_key
         SLACK_WEBHOOK_URL:
           from_secret: slack_webhook_url
       commands:
@@ -56,15 +69,17 @@ trigger:
 kind: pipeline
 name: scan-build
 
-node:
-  freeswitch: public
-
 steps:
-    - name: scan-build
+    - name: bootstrap
       image: signalwire/freeswitch-public-base:stretch
       pull: true
       commands:
       - ./bootstrap.sh -j
+
+    - name: configure
+      image: signalwire/freeswitch-public-base:stretch
+      pull: true
+      commands:
       - cp build/modules.conf.most modules.conf
       #Enable/Uncomment mods
       - echo 'codecs/mod_openh264' >> modules.conf
@@ -89,6 +104,11 @@ steps:
       - sed -i '/mod_unimrcp/s/^/#/g' modules.conf
       - sed -i '/mod_xml_rpc/s/^/#/g' modules.conf
       - ./configure
+
+    - name: scan-build
+      image: signalwire/freeswitch-public-base:stretch
+      pull: true
+      commands:
       - mkdir -p scan-build
       - echo '#!/bin/bash\nscan-build-4.0 -o ./scan-build/ make -j`nproc --all` |& tee ./scan-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./scan-build-status.txt\n' > scan.sh
       - chmod +x scan.sh
@@ -97,13 +117,13 @@ steps:
       - echo "*** Exit status is $exitstatus"
 
     - name: notify
-      image: signalwire/scan-build-notify
+      image: signalwire/public-scan-build-notify
       pull: true
       environment:
         GITHUB_CI_APP_PEM:
           from_secret: github_ci_app_pem
         SSH_KEY:
-          from_secret: ssh_key
+          from_secret: public_artifacts_ssh_key
         SLACK_WEBHOOK_URL:
           from_secret: slack_webhook_url
       commands:
@@ -119,6 +139,6 @@ trigger:
 
 ---
 kind: signature
-hmac: dcc23ab357643343e144d6371bc2accbc25dcf18c6554bce1d7dc5ba532e9b41
+hmac: 430f5a243e6029b985fa0219e9fb44c71a59931af44a3230751e238f8b64dd32
 
 ...