GitHub Action to run PHPUnit or Pest unit tests with optional code coverage.
- uses: zeroseven/action-phpunit@v1
with:
config: 'phpunit.xml'| Input | Description | Required | Default |
|---|---|---|---|
php-version |
PHP version | No | 8.3 |
config |
Path to phpunit.xml | Yes | - |
testsuite |
Test suite to run | No | `` |
group |
Test groups | No | `` |
coverage |
Enable code coverage | No | false |
coverage-format |
Coverage format | No | clover |
extensions |
PHP extensions | No | mbstring, xml, json, pdo |
steps:
- uses: actions/checkout@v4
- uses: zeroseven/action-php-build@v1
- uses: zeroseven/action-phpunit@v1
with:
config: 'phpunit.xml'steps:
- uses: actions/checkout@v4
- uses: zeroseven/action-php-build@v1
- uses: zeroseven/action-phpunit@v1
with:
config: 'phpunit.xml'
coverage: 'true'
coverage-format: 'clover'jobs:
test:
strategy:
matrix:
php-version: ['8.2', '8.3']
steps:
- uses: actions/checkout@v4
- uses: zeroseven/action-php-build@v1
- uses: zeroseven/action-phpunit@v1
with:
php-version: ${{ matrix.php-version }}
config: 'phpunit.xml'MIT