Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,33 @@ jobs:
- name: Tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: xdebug

- name: Cache PHP dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.4-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-8.4-composer-

- name: Install dependencies
run: composer install

- name: Run tests with coverage
run: composer coverage

phpstan:
name: PHPStan Static Analysis
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.cache
*.code-workspace
composer.lock
coverage-html
env.php
phpunit.xml
vendor
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"scripts": {
"demo": "php -S localhost:8888 demo/index.php",
"test": "phpunit",
"coverage": "phpunit --coverage-text",
"coverage-report": "phpunit --coverage-html coverage-html",
"cs-fix": "php-cs-fixer fix",
"phpstan": "phpstan --memory-limit=-1",
"update-resources": [
Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@
<group>ignore</group>
</exclude>
</groups>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>src/resources</directory>
</exclude>
</coverage>
</phpunit>