From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

According to the documentation post_ci is executed only if ci finished
successfully. Move test result reporting to separate script and call it
from on_success and on_failure steps.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
/** Email created from pull request 441 (lumag:shippable-ci)
 ** https://github.com/Linaro/odp/pull/441
 ** Patch: https://github.com/Linaro/odp/pull/441.patch
 ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd
 ** Merge commit sha: eb9e424b83553d93732577a9ba50c59a684ca7ea
 **/
 .shippable.yml            | 10 +++-------
 scripts/shippable-post.sh | 12 ++++++++++++
 2 files changed, 15 insertions(+), 7 deletions(-)
 create mode 100755 scripts/shippable-post.sh

diff --git a/.shippable.yml b/.shippable.yml
index 9bc2cb6f7..35292d983 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -40,14 +40,10 @@ build:
     - make
     - sudo env ODP_SHM_DIR=/dev/shm/odp ODP_TEST_OUT_XML=yes make check
 
-  post_ci:
-    - wget 
https://raw.githubusercontent.com/shawnliang/cunit-to-junit/master/cunit-to-junit.xsl
-    - |
-      for FILE in `find  ./test ./platform/ -name  "*.xml"`; do
-         bname=`basename $FILE`;
-         xsltproc --novalid cunit-to-junit.xsl $FILE > 
$SHIPPABLE_BUILD_DIR/shippable/testresults/${bname}
-      done
+  on_success:
+    - ./scripts/shippable-post.sh
 
   on_failure:
+    - ./scripts/shippable-post.sh
     - cat config.log
     - find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read 
trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done
diff --git a/scripts/shippable-post.sh b/scripts/shippable-post.sh
new file mode 100755
index 000000000..0f57c24ff
--- /dev/null
+++ b/scripts/shippable-post.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+wget 
https://raw.githubusercontent.com/shawnliang/cunit-to-junit/master/cunit-to-junit.xsl
+
+for FILE in `find  ./test ./platform/ -name  "*.xml"`; do
+       bname="`basename $FILE`";
+       xsltproc --novalid cunit-to-junit.xsl "$FILE" > \
+               "$SHIPPABLE_BUILD_DIR/shippable/testresults/${bname}"
+done
+
+mkdir -p shippable/codecoverage
+gcovr -r . --xml-pretty > shippable/codecoverage/coverage.xml

Reply via email to