---
name: Test
on:
  push:
    paths:
      - '**.php'
      - 'composer.json'
    branches:
      - 'main'
  pull_request:
    paths:
      - '**.php'
      - 'composer.json'
    branches:
      - 'main'
  workflow_dispatch:
jobs:
  run:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
    #continue-on-error: ${{ matrix.php == '8.1' }}
    name: PHP ${{ matrix.php }} Test
    steps:
      - name: Git checkout
        uses: actions/
[email protected]
      - name: Setup PHP
        uses: shivammathur/
[email protected]
        with:
          php-version: ${{ matrix.php }}
          extensions: json
          coverage: pcov
        env:
          COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Setup problem matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
      - name: Install dependencies
        run: composer update --prefer-dist --no-interaction
      - name: Run phpcs
        run: composer cs-check -- -v
      - name: Setup PCOV
        if: matrix.php == '7.1'
        run: |
          composer require pcov/clobber
          vendor/bin/pcov clobber
      - name: Execute tests
        run: composer test -- -v --coverage-clover=coverage.xml
      - name: Run codecov
        uses: codecov/codecov-action@v1