name: CI

on:
  push:
  pull_request:

jobs:
  test:
    name: "PHPUnit: PHP ${{ matrix.php }}"

    strategy:
      matrix:
        include:
          - php: '8.0'
          - php: '8.1'

    runs-on: ubuntu-latest

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

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

      - name: Install dependencies
        run: composer install

      - name: Run tests
        run: composer phpunit
