name: Run PHPUnit Tests on Multiple PHP Versions

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  phpunit:
    runs-on: ubuntu-20.04

    strategy:
      matrix:
        php: [ '7.4','8.0','8.1','8.2','8.3','8.4' ]

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

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

      - name: Install Composer dependencies
        run: composer install --prefer-dist --no-progress

      - name: Run PHPUnit
        run: vendor/bin/phpunit --verbose
