From a4c4739626813ff207276e9804aa73dcca5ff3c6 Mon Sep 17 00:00:00 2001
From: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Date: Thu, 11 Jan 2018 03:41:19 +0100
Subject: [PATCH] Travis: upload the coverage data as part of the script
 (#6877)

According to Travis docs the exit code of after_success doesn't affect
the build result. Instead, uploading the coverage data as the last step
of the script will cause the job to fail if the command exits with
non-zero.

https://docs.travis-ci.com/user/customizing-the-build/#Breaking-the-Build
---
 .travis.yml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5b92f622b6..61b829a9c5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -149,10 +149,9 @@ before_script:
 #=============================================================================
 # Building
 #=============================================================================
-script: share/spack/qa/run-$TEST_SUITE-tests
-
-after_success:
-  - codecov --env PY_VERSION
+script:
+  - share/spack/qa/run-$TEST_SUITE-tests
+  - if [[ "$COVERAGE" == "true" ]]; then codecov --env PY_VERSION --required ; fi
 
 #=============================================================================
 # Notifications
-- 
GitLab