Skip to content

Commit 4dec371

Browse files
committed
Travis: move coverage processing to after_success
Move the processing of coverage information to the `after_success` step to ensure it cannot alter the state of the build anymore. It would do this on private forks if people don't have a coveralls setup for their private fork.
1 parent 0cd92dd commit 4dec371

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,19 @@ install:
5050

5151
script: ./travis.sh
5252

53+
after_success:
54+
- if [ -n "${COVERALLS_SERVICE_NAME}" ]; then
55+
lcov --rc lcov_branch_coverage=1 --directory build --capture --output-file coverage.info &&
56+
lcov --rc lcov_branch_coverage=1 --remove coverage.info
57+
"${PWD}/3rdparty/*"
58+
"${PWD}/build/*"
59+
"${PWD}/examples/*"
60+
"${PWD}/features/*"
61+
"${PWD}/tests/*"
62+
"/usr/*"
63+
--output-file coverage.info &&
64+
lcov --rc lcov_branch_coverage=1 --list coverage.info &&
65+
coveralls-lcov coverage.info ;
66+
fi
67+
5368
# default notifications: https://docs.travis-ci.com/user/notifications#Notifications

travis.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,3 @@ if [ -n "${XVFBPID:-}" ]; then
9191
kill $XVFBPID
9292
wait
9393
fi
94-
95-
if [ -n "${COVERALLS_SERVICE_NAME}" ]; then
96-
lcov --rc lcov_branch_coverage=1 --directory build --capture --output-file coverage.info
97-
lcov --rc lcov_branch_coverage=1 --remove coverage.info \
98-
"${PWD}/3rdparty/*" \
99-
"${PWD}/build/*" \
100-
"${PWD}/examples/*" \
101-
"${PWD}/features/*" \
102-
"${PWD}/tests/*" \
103-
"/usr/*" \
104-
--output-file coverage.info
105-
lcov --rc lcov_branch_coverage=1 --list coverage.info
106-
coveralls-lcov coverage.info
107-
fi

0 commit comments

Comments
 (0)