name: Tests

on:
  - "push"
  - "pull_request"

jobs:
  tests:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-versions: ['7.3', '7.4', '8.0']

    steps:
    - uses: actions/checkout@v2

    - name: "Cache Composer packages"
      id: "composer-cache"
      uses: actions/cache@v2
      with:
        path: "vendor"
        key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          "${{ runner.os }}-php-"

    - name: "Setup PHP Action"
      uses: "shivammathur/setup-php@v2"
      with:
        php-version: "${{ matrix.php-versions }}"
        extensions: "intl, xdebug"

    - name: "Install dependencies"
      if: steps.composer-cache.outputs.cache-hit != 'true'
      run: if [[ "${{ matrix.php-versions }}" == "8.0" ]]; then composer update --ignore-platform-reqs; else composer install --prefer-dist --no-progress --no-suggest; fi;

    - name: "Unit + Integration"
      run: vendor/bin/phpunit
    
    - name: "Mutation tests"
      run: vendor/bin/infection --min-msi=99 --no-progress --threads=5

name: Tests

on:
  - "push"
  - "pull_request"

jobs:
  tests:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-versions: ['7.3', '7.4', '8.0']

    steps:
    - uses: actions/checkout@v2

    - name: "Cache Composer packages"
      id: "composer-cache"
      uses: actions/cache@v2
      with:
        path: "vendor"
        key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          "${{ runner.os }}-php-"

    - name: "Setup PHP Action"
      uses: "shivammathur/setup-php@v2"
      with:
        php-version: "${{ matrix.php-versions }}"
        extensions: "intl, xdebug"

    - name: "Install dependencies"
      if: steps.composer-cache.outputs.cache-hit != 'true'
      run: composer install --prefer-dist --no-progress --no-suggest

    - name: "Unit + Integration"
      run: vendor/bin/phpunit
    
    - name: "Mutation tests"
      run: vendor/bin/infection --min-msi=99 --no-progress --threads=5

Remove install differences for php 8
Remove install differences for php 8
