Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
  • Loading branch information
wshafer committed Sep 21, 2017
1 parent d69d376 commit 1b17793
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# for php-coveralls
coverage_clover: clover.xml
json_path: coveralls-upload.json
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ php:
- 7.0
- 7.1

cache:
directories:
- $HOME/.composer/cache

before_script:
- composer self-update
- composer install --prefer-dist -n

script:
- ./vendor/bin/phpunit tests/
- ./vendor/bin/phpunit tests/ --coverage-clover clover.xml
- ./vendor/bin/phpcs --extensions=php --standard=PSR2 --ignore=*/_files/* src/ tests/
# - ./vendor/bin/phpmd ./src text ./phpmd.xml --suffixes php

after_success:
- travis_retry php vendor/bin/coveralls -v -x clover.xml
- bash <(curl -s https://codecov.io/bash)
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"require-dev": {
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "~3.0",
"phpmd/phpmd" : "@stable",
"zendframework/zend-servicemanager": "^3.1.1",
"zendframework/zend-diactoros": "^1.4.0"
},
Expand Down
27 changes: 27 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<ruleset name="Custom Rule Set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
Custom Rule Set
</description>

<rule ref="rulesets/cleancode.xml" />
<rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
</rule>

<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id" />
</properties>
</rule>
</ruleset>
10 changes: 10 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<phpunit>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">Exception</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 1b17793

Please sign in to comment.