From d79cbe8d7efc7abd58621550e925aefa87af891d Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Sat, 17 Sep 2016 14:09:48 +0200 Subject: [PATCH 1/4] Use phar version of ocular It's impossible to install the latest version of Guzzle due ocular (used to upload code coverage) depending on guzzlehttp/guzzle ~3.0. See https://github.com/scrutinizer-ci/ocular/blob/master/composer.json Closes #95 Inspired by https://github.com/Ocramius/ProxyManager/blob/master/.travis.coverage.sh --- .travis.coverage.sh | 5 +++++ .travis.yml | 2 +- composer.json | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .travis.coverage.sh diff --git a/.travis.coverage.sh b/.travis.coverage.sh new file mode 100644 index 0000000..b3ee40a --- /dev/null +++ b/.travis.coverage.sh @@ -0,0 +1,5 @@ +set -x +if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]] ; then + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover coverage.clover +fi diff --git a/.travis.yml b/.travis.yml index 2b406dd..b234ccb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,4 @@ script: - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover after_script: - - if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi + - sh .travis.coverage.sh diff --git a/composer.json b/composer.json index 098b0b1..34a9c47 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,6 @@ }, "require-dev": { "phpunit/phpunit" : "~4.0||~5.0", - "scrutinizer/ocular": "~1.1", "squizlabs/php_codesniffer": "^2.3" }, "autoload": { From abf471b40fdaed9fc65c8aad98ab42e0e6b0f4fb Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Sat, 17 Sep 2016 14:15:13 +0200 Subject: [PATCH 2/4] Add .travis.coverage.sh to gitattributes --- .gitattributes | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index b263871..31f0c98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,9 +2,10 @@ # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html # Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore -/tests export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/.travis.coverage.sh export-ignore +/phpunit.xml.dist export-ignore +/.scrutinizer.yml export-ignore +/tests export-ignore From ef616202664fb79a7b9d2da98d317237ecd86c8f Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Mon, 19 Sep 2016 08:29:46 +0200 Subject: [PATCH 3/4] Don't use separate file for uploading code coverage --- .travis.coverage.sh | 5 ----- .travis.yml | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 .travis.coverage.sh diff --git a/.travis.coverage.sh b/.travis.coverage.sh deleted file mode 100644 index b3ee40a..0000000 --- a/.travis.coverage.sh +++ /dev/null @@ -1,5 +0,0 @@ -set -x -if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]] ; then - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover -fi diff --git a/.travis.yml b/.travis.yml index b234ccb..c8dc61d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,8 @@ script: - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover after_script: - - sh .travis.coverage.sh + - | + if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' && "$TRAVIS_PHP_VERSION" != '7.0' ]]; then + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover coverage.clover + fi From f145704730749ef8a16c977e659bd9b8379e13ef Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Mon, 19 Sep 2016 08:33:37 +0200 Subject: [PATCH 4/4] Remove .travis.codecoverage.sh from git attributes --- .gitattributes | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitattributes b/.gitattributes index 31f0c98..b263871 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,10 +2,9 @@ # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html # Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/.travis.coverage.sh export-ignore -/phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore -/tests export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/.scrutinizer.yml export-ignore +/tests export-ignore