sudo: false

language: php
php:
  - 5.6
  - 7.0
  - 7.1
  - 7.2
  - 7.3
  - 7.4
  - 8.0
  - nightly

stages:
  - analyze
  - test

jobs:
  fast_finish: true
  allow_failures:
    - php: nightly
  include:
    - stage: analyze
      php: 7.4
      install:
        - composer install --prefer-dist
      script:
        - php vendor/bin/php-cs-fixer fix --dry-run --diff
        - composer validate
        - find OLE* -type f -name \*.php | xargs -n1 php -l

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.cache/cache

install:
  - composer remove --no-update --dev
        friendsofphp/php-cs-fixer
  - composer install --prefer-dist

script:
  - vendor/bin/phpunit --verbose
