Skip to content

Commit daa783b

Browse files
committed
Added Codecov
+ Updated Readme
1 parent c6bc397 commit daa783b

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.github/workflows/Test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,23 @@ jobs:
3333
with:
3434
php-version: ${{ matrix.php }}
3535
extensions: json
36-
coverage: none
37-
tools: phpunit
36+
coverage: pcov
3837
env:
3938
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4039

4140
- name: Setup problem matchers for PHPUnit
4241
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
43-
42+
4443
- name: Install dependencies
4544
run: composer install --prefer-dist --no-interaction --no-suggest
4645

46+
- name: Setup PCOV
47+
run: |
48+
composer require pcov/clobber
49+
vendor/bin/pcov clobber
50+
4751
- name: Execute tests
48-
run: vendor/bin/phpunit --verbose
52+
run: ./vendor/bin/phpunit -v --configuration ./phpunit.xml.dist --coverage-clover=coverage.xml
53+
54+
- name: Run codecov
55+
uses: codecov/codecov-action@v1

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
JSONPath for PHP 7.1+ ![Test](https://github.com/SoftCreatR/JSONPath/workflows/Test/badge.svg?branch=main)
1+
JSONPath for PHP 7.1+
22
=============
33

4+
[![Build Status](https://img.shields.io/github/workflow/status/SoftCreatR/JSONPath/Test/main?label=Build%20Status)](https://github.com/SoftCreatR/JSONPath/actions?query=workflow%3ATest)
5+
[![Latest Release](https://img.shields.io/packagist/v/SoftCreatR/JSONPath?color=blue&label=Latest%20Release)](https://packagist.org/packages/softcreatr/jsonpath)
6+
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
7+
[![Codecov branch](https://img.shields.io/codecov/c/github/SoftCreatR/JSONPath/main)](https://codecov.io/gh/SoftCreatR/JSONPath/)
8+
49
This is a [JSONPath](http://goessner.net/articles/JsonPath/) implementation for PHP based on Stefan Goessner's JSONPath script.
510

611
JSONPath is an XPath-like expression language for filtering, flattening and extracting data.

phpunit.xml.dist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
>
77
<testsuites>
88
<testsuite name="Unit">
9-
<directory suffix="Test.php">./tests</directory>
9+
<directory>./tests</directory>
1010
</testsuite>
1111
</testsuites>
12-
<coverage processUncoveredFiles="true">
13-
<include>
14-
<directory suffix=".php">./src</directory>
15-
</include>
16-
</coverage>
12+
<filter>
13+
<whitelist>
14+
<directory suffix=".php">./src/</directory>
15+
</whitelist>
16+
</filter>
1717
</phpunit>

0 commit comments

Comments
 (0)