name: Unit tests

on:
  push:
    branches: [ master ]
  pull_request:

jobs:
  build:
    strategy:      
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']
        phpunit: ['6.0', '7.0', '8.0', '9.0']
        exclude:
        - php: '7.2'
          phpunit: '9.0'
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
      
    - name: Setup PHP
      uses: shivammathur/setup-php@v1
      with:
        php-version: ${{ matrix.php }}
        extensions: mbstring, intl, json, mongodb
        coverage: pcov
    
    - name: Validate composer.json and composer.lock
      run: composer validate

    - name: Declare required PHPUnit version
      run: |
        composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}

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

    #- name: Run type checker
    #  run: ./vendor/bin/psalm
      
    - name: Run unit tests
      run: ./vendor/bin/phpunit --testdox

name: Unit tests

on:
  push:
    branches: [ master ]
  pull_request:

jobs:
  build:
    strategy:      
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0']
        phpunit: ['6.0', '7.0', '8.0', '9.0']
        exclude:
        - php: '7.2'
          phpunit: '9.0'
        - php: '8.0'
          phpunit: '6.0'
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
      
    - name: Setup PHP
      uses: shivammathur/setup-php@v1
      with:
        php-version: ${{ matrix.php }}
        extensions: mbstring, intl, json, mongodb
        coverage: pcov
    
    - name: Validate composer.json and composer.lock
      run: composer validate

    - name: Declare required PHPUnit version
      run: |
        composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}

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

    #- name: Run type checker
    #  run: ./vendor/bin/psalm
      
    - name: Run unit tests
      run: ./vendor/bin/phpunit --testdox

Exclude PHP 8.0 + PHPUnit 6
Exclude PHP 8.0 + PHPUnit 6
