name: CI

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  phpunit:
    name: PHP ${{ matrix.php }} ${{ matrix.env.COMPOSER_FLAGS }}
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        include:
          - php: '7.1'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.2'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.3'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.4'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '8.0'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '8.1'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.1'
            env:
              COMPOSER_FLAGS: "--prefer-lowest"
          - php: '8.0'
            env:
              COMPOSER_FLAGS: "--prefer-lowest"

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

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install composer dependencies
        run: |
          composer update --prefer-dist --no-interaction --no-progress --no-ansi ${COMPOSER_FLAGS}

      - name: Execute tests
        run: |
          composer validate --strict --no-check-lock
          vendor/bin/phpunit

name: CI

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  phpunit:
    name: PHP ${{ matrix.php }} ${{ matrix.env.COMPOSER_FLAGS }}
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        include:
          - php: '7.1'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.2'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.3'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.4'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '8.0'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '8.1'
            env:
              SYMFONY_REQUIRE: "*"
          - php: '7.1'
            env:
              COMPOSER_FLAGS: "--prefer-lowest"
          - php: '8.1'
            env:
              COMPOSER_FLAGS: "--prefer-lowest"

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

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install composer dependencies
        run: |
          composer update --prefer-dist --no-interaction --no-progress --no-ansi ${COMPOSER_FLAGS}

      - name: Execute tests
        run: |
          composer validate --strict --no-check-lock
          vendor/bin/phpunit

Use PHP 8.1 for prefer lowest
Use PHP 8.1 for prefer lowest
