Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RobQuistNL committed Apr 25, 2023
1 parent f017e9a commit 53b3d8f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@ jobs:

- uses: php-actions/composer@v6

- name: PHPUnit Tests
uses: php-actions/phpunit@master
- name: Cache vendor folder
uses: actions/cache@v3
with:
bootstrap: vendor/autoload.php
configuration: phpunit.xml
path: "vendor"
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: "/tmp/cache"
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Run PHPUnit + Coverage
run: vendor/bin/phpunit --coverage-clover ./coverage.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODE_COV_TOKEN }}
files: ./coverage.xml
verbose: true
8 changes: 7 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="PHP ByteArray Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage/>
<coverage cacheDirectory=".phpunit.cache/code-coverage">
</coverage>
<source>
<include>
<directory suffix=".php">src</directory>
Expand Down

0 comments on commit 53b3d8f

Please sign in to comment.