Skip to content

Commit 1f20bf6

Browse files
authored
fix coveralls error for partial testing (GoogleCloudPlatform#415)
1 parent d694e60 commit 1f20bf6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,12 @@ script:
4747
- testing/run_all_tests.sh
4848

4949
after_success:
50-
- composer require "satooshi/php-coveralls:^1.0"
51-
- travis_retry php vendor/bin/coveralls -v
50+
- |
51+
# if we are running all the tests, run coveralls
52+
FILES_CHANGED=$(git diff --name-only HEAD $(git merge-base HEAD master))
53+
if grep -q ^testing\/ <<< "$FILES_CHANGED" || \
54+
grep -qv \/ <<< "$FILES_CHANGED" || \
55+
[ -e $TRAVIS_PULL_REQUEST_BRANCH ]; then
56+
composer require "satooshi/php-coveralls:^1.0"
57+
travis_retry php vendor/bin/coveralls -v
58+
fi

0 commit comments

Comments
 (0)