name: PHP Composer

on: [push,pull_request]

jobs:
  build:
    name: Test PHP ${{ matrix.php-version }}

    strategy:
      matrix:
        php-version: ['7.2', '7.3', '7.4']

    runs-on: ubuntu-latest

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

    - name: Setup PHP, with composer and extensions
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-version }}
        extension-csv: dom, mbstring
        # coverage: xdebug

    - name: Validate composer.json and composer.lock
      run: composer validate

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

    - name: Run test suite
      run: composer run-script test
