language: php
sudo: false
dist: trusty

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

services:
    - riak
    - mongodb
    - memcached
    - redis-server

before_script:
    - ./Tests/travis/install-deps.sh
    - composer self-update
    - if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
    - composer update --prefer-dist

script:
    - ./vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml
    - ./vendor/bin/phpcs -np --extensions=php --ignore=vendor/*,Tests/* --standard=ruleset.xml .

after_script:
    - php ./vendor/bin/coveralls -v

matrix:
    exclude:
        - php: 5.3
          dist: trusty
    allow_failures:
        - php: nightly
    include:
        - php: 5.3
          dist: precise
        - php: 5.4
        - php: 5.5
        - php: 5.6
          env: DEPS="dev"
        - php: 7.0
        - php: 7.1
        - php: 7.2
        - php: nightly
