name: Tests

on:
  push:
    branches:
      - master
    tags:
      - '*'
  pull_request:
    branches:
      - master

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  tests:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']

    name: PHP ${{ matrix.php }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 100

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: ${{ matrix.php != '7.2' && 'none' || 'xdebug' }}

      - name: Install composer dependencies
        uses: php-actions/composer@v5

      - name: Run unit tests
        if: matrix.php == '7.2'
        run: |
          vendor/bin/phpunit --coverage-clover=coverage.clover
          wget https://scrutinizer-ci.com/ocular.phar
          php ocular.phar code-coverage:upload --format=php-clover coverage.clover
      - name: Run unit tests
        if: matrix.php != '7.2'
        run: |
          vendor/bin/phpunit

name: Tests

on:
  push:
    branches:
      - master
    tags:
      - '*'
  pull_request:
    branches:
      - master

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  tests:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']

    name: PHP ${{ matrix.php }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 100

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: ${{ matrix.php != '7.2' && 'none' || 'xdebug' }}

      - name: Install composer dependencies
        uses: php-actions/composer@v6
        with:
          php_version: 7.2

      - name: Run unit tests
        if: matrix.php == '7.2'
        run: |
          vendor/bin/phpunit --coverage-clover=coverage.clover
          wget https://scrutinizer-ci.com/ocular.phar
          php ocular.phar code-coverage:upload --format=php-clover coverage.clover
      - name: Run unit tests
        if: matrix.php != '7.2'
        run: |
          vendor/bin/phpunit

Fix php version for composer
Fix php version for composer
