name: CI MQTT

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  run:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      fail-fast: false
      matrix:
        operating-system: [ubuntu-latest]
        php-versions: ['7.3', '7.4', '8.0']
    name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

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

    - uses: actions/checkout@v2

    - name: Show php version
      run: php --version

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

    - name: Install dependencies
      if: ${{ matrix.php-versions != '8.0' && steps.composer-cache.outputs.cache-hit != 'true' }}
      run: composer install --prefer-dist --no-progress --no-suggest

    - name: Install dependencies ignoring platform requirements
      if:  ${{ matrix.php-versions == '8.0' }}
      continue-on-error: true
      run: composer install --no-progress --no-interaction --ignore-platform-reqs

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

    - name: Run PHPCS
      run: composer run-script cs

    - name: Run PHPStan
      run: composer run-script stan

name: CI MQTT

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  run:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      fail-fast: false
      matrix:
        operating-system: [ubuntu-latest]
        php-versions: ['7.1', '7.2', '7.3', '7.4']
    name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

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

    - uses: actions/checkout@v2

    - name: Show php version
      run: php --version

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

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

    - name: Install dependencies ignoring platform requirements
      run: composer install --no-progress --no-interaction --ignore-platform-reqs

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

    - name: Run PHPCS
      run: composer run-script cs

    - name: Run PHPStan
      run: composer run-script stan

Test all supported PHP versions
Test all supported PHP versions
