Skip to content

Commit

Permalink
Enable coveralls (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-georgiev committed Aug 12, 2018
1 parent d0ea706 commit a70ba30
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,16 @@ script:
else
composer check-security;
fi;
- composer run-tests
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
echo "Tests with reporting in Clover format are skipped for older PHP versions";
composer run-tests;
else
composer run-tests-with-clover;
fi;

after_script:
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
echo "Coveralls report is skipped for older PHP versions";
else
bin/php-coveralls -v;
fi;
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/martin-georgiev/social-post/badges/quality-score.png)](https://scrutinizer-ci.com/g/martin-georgiev/social-post/?branch=master)
[![Build Status](https://api.travis-ci.org/martin-georgiev/social-post.svg?branch=master)](https://www.travis-ci.org/martin-georgiev/social-post)
[![Coverage Status](https://coveralls.io/repos/github/martin-georgiev/social-post/badge.svg?branch=master)](https://coveralls.io/github/martin-georgiev/social-post?branch=master)
[![Latest Stable Version](https://poser.pugx.org/martin-georgiev/social-post/version)](https://packagist.org/packages/martin-georgiev/social-post)
[![Total Downloads](https://poser.pugx.org/martin-georgiev/social-post/downloads)](https://packagist.org/packages/martin-georgiev/social-post)

Expand All @@ -12,7 +13,7 @@ This is a library that provides centralised gateway for publishing post updates
## How to install it?
Recommended way is through [Composer](https://getcomposer.org/download/)

composer require "martin-georgiev/social-post"
composer require martin-georgiev/social-post


----
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"jakub-onderka/php-parallel-lint": "^1.0",
"phpstan/phpstan": "^0.10.2",
"phpunit/phpunit": "^7.2",
"satooshi/php-coveralls": "^2.0",
"sensiolabs/security-checker": "^4.1",
"symfony/phpunit-bridge": "^3.0|^4.0"
},
Expand All @@ -61,6 +62,9 @@
"run-tests": [
"bin/phpunit"
],
"run-tests-with-clover": [
"bin/phpunit --coverage-clover build/logs/clover.xml"
],
"validate-files": [
"bin/parallel-lint --exclude vendor --exclude bin ."
]
Expand Down
45 changes: 16 additions & 29 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>

colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="false"
convertWarningsToExceptions="true"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
verbose="true"
syntaxCheck="true">

<testsuites>
<testsuite name="Package's Test Suite">
<directory>tests/</directory>
<testsuite>
<directory>./tests</directory>
</testsuite>
</testsuites>

<logging>
<log type="coverage-html" target="docs/tests/coverage/html/" />
<log type="coverage-clover" target="docs/tests/coverage/coverage.xml" />
</logging>


<filter>
<whitelist
addUncoveredFilesFromWhitelist="true"
processUncoveredFilesFromWhitelist="true"
>
<directory>src/</directory>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>

<php>
<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />
</php>
</phpunit>

</phpunit>

0 comments on commit a70ba30

Please sign in to comment.