on:
  - pull_request
  - push

name: CI

jobs:
  tests:
    name: Tests
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os:
          - ubuntu-latest
          - windows-latest

        php:
          - "7.0"
          - "7.1"
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"

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

      - name: Configure PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: pcov
          ini-values: assert.exception=1, zend.assertions=1

      - name: Install composer dependencies ignoring platform requirements
        if: matrix.php == '8.0'
        run: composer install --no-interaction --prefer-dist --ignore-platform-reqs

      - name: Install composer dependencies
        if: matrix.php != '8.0'
        run: composer update --no-interaction --prefer-dist

      - name: Run tests with phpunit
        run: vendor/bin/phpunit --coverage-clover=coverage.xml

      - name: Send code coverage report to Codecov.io
        uses: codecov/codecov-action@v1

on:
  - pull_request
  - push

name: CI

jobs:
  tests:
    name: Tests
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os:
          - ubuntu-latest
          - windows-latest

        php:
          - "7.0"
          - "7.1"
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"

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

      - name: Configure PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: xdebug
          ini-values: assert.exception=1, zend.assertions=1

      - name: Install composer dependencies ignoring platform requirements
        if: matrix.php == '8.0'
        run: composer install --no-interaction --prefer-dist --ignore-platform-reqs

      - name: Install composer dependencies
        if: matrix.php != '8.0'
        run: composer update --no-interaction --prefer-dist

      - name: Run tests with phpunit
        run: vendor/bin/phpunit --coverage-clover=coverage.xml

      - name: Send code coverage report to Codecov.io
        uses: codecov/codecov-action@v1

Use xdebug for CI code coverage
Use xdebug for CI code coverage
