Skip to content

Commit

Permalink
Merge pull request #1 from Astylodon/coverage
Browse files Browse the repository at this point in the history
Add code coverage
  • Loading branch information
TheIndra55 authored May 8, 2024
2 parents 8b27d83 + 7e2df50 commit 994dd0b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ jobs:
run: composer install --prefer-dist --no-progress

- name: Test
run: vendor/bin/phpunit tests
env:
XDEBUG_MODE: coverage
run: vendor/bin/phpunit --coverage-clover coverage.xml tests

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
coverage.xml
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ composer require astylodon/migrations

### Database

This library is independent of a database implementation, we instead provide a `DatabaseInterface` interface that should be implemented by the database implementation.
This library is independent of a database implementation, instead a `DatabaseInterface` interface is provided that should be implemented by the database implementation.

### Example

Create a file that you will invoke when your migrations run.
Create a file that you will invoke to run your migrations.

```php
<?php
Expand Down Expand Up @@ -46,4 +46,4 @@ return new class implements Migration
// Your database migrations here
}
};
```
```
19 changes: 19 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</phpunit>

0 comments on commit 994dd0b

Please sign in to comment.