language: php

cache:
  directories:
    - vendor

matrix:
    include:
        - php: 5.6
          env:
            - COMPOSER_FLAGS='--prefer-lowest'
        - php: 7.0
        - php: 7.1
        - php: 7.2
        - php: 7.3
        - php: 7.4
        - php: 8.0
        - php: 8.1
          env:
            - COVERAGE='--coverage --coverage-xml'
              XDEBUG_MODE=coverage

before_install:
    - if [[ ! $COVERAGE ]]; then phpenv config-rm xdebug.ini; fi;

before_script: composer update -n $COMPOSER_FLAGS

script:
    - vendor/bin/phpcs
    - vendor/bin/codecept run unit $COVERAGE

after_script:
    - if [[ $COVERAGE ]]; then ./coverage.sh; fi;
