name: Tests

on:
  push:
  pull_request:

jobs:
  tests:
    name: PHP ${{ matrix.php }}
    runs-on: ubuntu-20.04

    strategy:
      matrix:
        php: ['8.0', '8.1', '8.2']

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

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

      - name: Install Dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer update --no-interaction --no-progress

      - name: Install PHPUnit
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer bin phpunit update --no-interaction --no-progress

      - name: Execute PHPUnit
        run: vendor/bin/phpunit

name: Tests

on:
  push:
  pull_request:

jobs:
  tests:
    name: PHP ${{ matrix.php }}
    runs-on: ubuntu-20.04

    strategy:
      matrix:
        php: ['8.0', '8.1', '8.2']

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

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

      - name: Install Dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer update --no-interaction --no-progress

      - name: Execute PHPUnit
        run: vendor/bin/phpunit

  coverage:
    name: Test Coverage
    runs-on: ubuntu-20.04

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

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.0'
          tools: composer:2.4.3
          coverage: none

      - name: Install Dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 5
          max_attempts: 5
          command: composer update --no-interaction --no-progress

      - name: Execute PHPUnit
        run: vendor/bin/phpunit --coverage-clover=coverage.xml

      - name: Upload to Codecov
        uses: codecov/codecov-action@v3
        with:
          files: ./coverage.xml
          verbose: true

Upgrade PHP version to min 8.0
Upgrade PHP version to min 8.0
