Skip to content

Commit

Permalink
fix: coverage workflow (#22)
Browse files Browse the repository at this point in the history
* fix: coverage workflow

* chore: add xdebug

* fix: xdebug

* fix: workflow

* fix: workflow

* chore: update codecov upload

* docs: update codecov badge
  • Loading branch information
lukascivil authored Dec 22, 2019
1 parent 0407f34 commit dffe083
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Xdebug Action
uses: MilesChou/[email protected]

- name: Validate composer.json and composer.lock
run: composer validate

Expand All @@ -18,5 +21,10 @@ jobs:
- name: Run test suite
run: composer run-script test

- name: Run codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
# - name: Run codecov
# run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created by .ignore support plugin (hsz.mobi)
.idea
/vendor
clover.xml
coverage.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TreeWalker is a simple and small Library that will help you to work faster with

[![Build Status](https://github.com/lukascivil/TreeWalker/workflows/PHP%20Composer/badge.svg)]()
[![Total Downloads](https://poser.pugx.org/lukascivil/treewalker/downloads)](https://packagist.org/packages/lukascivil/treewalker)
[![codecov](https://codecov.io/gh/lukascivil/TreeWalker/branch/master/graph/badge.svg)](https://codecov.io/gh/lukascivil/TreeWalker)
[![License](https://poser.pugx.org/lukascivil/treewalker/license.svg)](https://packagist.org/packages/lukascivil/treewalker)

- getdiff() - Get json difference
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit --coverage-clover=coverage.xml",
"test": "vendor/bin/phpunit --coverage-text",
"check-format": "vendor/bin/phpcs --standard=PSR2 src",
"format": "vendor/bin/phpcbf --standard=PSR2 src && vendor/bin/phpcbf --standard=PSR2 tests"
},
Expand Down
9 changes: 7 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" verbose="true">
<phpunit bootstrap="vendor/autoload.php" colors="true" verbose="true">
<logging>
<log type="coverage-clover" target="clover.xml"/>
<log type="coverage-clover" target="./coverage.xml"/>
</logging>
<testsuites>
<testsuite name="unit">
<directory suffix=".php">tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit dffe083

Please sign in to comment.