name: ci

on: [push, pull_request, release]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        php-versions: ['7.4', '8.0']
        os: [ubuntu-18.04, ubuntu-20.04]
    name: PHP ${{ matrix.php-versions }} Test
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: mbstring
        coverage: xdebug

    - name: Validate Composer
      run: composer validate --strict

    - name: Install Composer Dependencies PHP
      run: composer install --no-interaction --prefer-dist

    - name: Run Tests
      run: composer run-script pipeline
      env:
        STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

    - name: Code Coverage
      run: bash <(curl -s https://codecov.io/bash)
