language: php
matrix:
  include:
    - php: 5.5.9
      dist: trusty
      env: deps=low
    - php: 5.5
      dist: trusty
    - php: 5.6
      env:
      dist: xenial
    - php: 7.0
      dist: xenial
    - php: 7.1
      env:
        - psalm=yes
      dist: bionic
    - php: 7.2
      env:
        - psalm=yes
      dist: bionic
    - php: 7.3
      dist: bionic
      env:
        - psalm=yes
    - php: 7.4
      env:
        - psalm=yes
      dist: bionic
#ppc64le support code
    - php: 5.6
      arch: ppc64le
      env:
      dist: xenial
    - php: 7.0
      arch: ppc64le
      dist: xenial
    - php: 7.1
      arch: ppc64le
      env:
        - psalm=yes
      dist: bionic
    - php: 7.2
      arch: ppc64le
      env:
        - psalm=yes
      dist: bionic
    - php: 7.4
      arch: ppc64le
      env:
        - psalm=yes
      dist: bionic

install:
  - if [ "$deps" = "low" ]; then composer update --prefer-lowest; else composer install; fi
  - if [ "$psalm" = "yes" ]; then composer require --dev vimeo/psalm:3.18.2; fi

before_script:
  - mkdir -p build/logs

script:
  - vendor/bin/phpunit --coverage-clover build/logs/clover.xml
  - if [ "$psalm" = "yes" ]; then vendor/bin/psalm; fi

after_script:
  - php vendor/bin/coveralls
  
