Skip to content

Add test coverage enforcement to CI #159

Add test coverage enforcement to CI

Add test coverage enforcement to CI #159

Workflow file for this run

name: Test
on:
push
jobs:
all-tests:
name: Run All Tests (PHP ${{matrix.php-version}})
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
php-version: [8.2, 8.3, 8.4, 8.5]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install dependencies
uses: php-actions/composer@v6
- name: Run PHPUnit tests
uses: php-actions/phpunit@v4
with:
php_version: ${{matrix.php-version}}
php_extensions: json zlib xdebug
configuration: phpunit.xml.dist
coverage_text: true
coverage_clover: coverage.xml
- name: Enforce coverage threshold
if: matrix.php-version == '8.2'
uses: ericsizemore/phpunit-coverage-check-action@2.0.0
with:
clover_file: 'coverage.xml'
threshold: '100'