Skip to content

Commit

Permalink
Add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhynds committed Dec 18, 2023
1 parent c83e288 commit 881b66c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ jobs:
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- name: Run tests
run: composer test
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: composer test
debug: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ tests/_support/_generated/*
vendor

# ignore the coverage folders
**/.phpunit.cache
**/coverage
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"mockery/mockery": "^1.4",
"nesbot/carbon": "^2.43",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
Expand All @@ -44,10 +44,12 @@
},
"scripts": {
"test": [
"phpunit",
"phpunit"
],
"lint": [
"php-cs-fixer fix -v --dry-run",
"phpstan analyse"
],
"lint": "php-cs-fixer fix -v --dry-run",
"lint-fix": "php-cs-fixer fix -v"
}
}
10 changes: 6 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
Expand All @@ -18,4 +15,9 @@
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>

0 comments on commit 881b66c

Please sign in to comment.