language: php
sudo: false
cache:
    directories:
        - $HOME/.composer/cache/files
        - $HOME/symfony-bridge/.phpunit

env:
    global:
        - PHPUNIT_FLAGS="-v"
        - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
        - SYMFONY_REQUIRE='>=2.8'

matrix:
    fast_finish: true
    include:
        - php: 7.1
        - php: 7.2
        - php: 7.3
          env: deps=low
        - php: 7.4
          env: SYMFONY_PHPUNIT_VERSION=9.4
        - php: 8.0
          env: SYMFONY_PHPUNIT_VERSION=9.4

before_install:
    - phpenv config-rm xdebug.ini || true
    - composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main

install:
    - |
      if [[ $deps = low ]]; then
          export SYMFONY_DEPRECATIONS_HELPER=weak
          composer update --prefer-dist --prefer-lowest --prefer-stable
      else
          composer update --prefer-dist
      fi
    - ./vendor/bin/simple-phpunit install

script:
    - composer validate --strict --no-check-lock
    - ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
