name: PHPUnit

on:
  push:
  pull_request:

jobs:
  phpunit:
    strategy:
      fail-fast: false
      matrix:
        php_version: ["7.4", "8.0", "8.1", "8.2", "latest"]

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php_version }}
          coverage: xdebug

      - name: Install PHP Packages
        run: composer install --no-progress

      - name: Run Tests
        env:
          XDEBUG_MODE: coverage
        run: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
