name: Tests

on:
  push:

jobs:

  test:
    name: PHPUnit Tests
    runs-on: ubuntu-latest

    strategy:
      matrix:
        include:
          - php: '7.4'
          - php: '8.0'
          - php: '8.1'
      fail-fast: false

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

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

      -   name: Install dependencies
          run: composer --prefer-source --no-progress --ansi install

      -   name: Run tests
          run: ./vendor/bin/phpunit --bootstrap bootstrap.php --configuration phpunit.xml