language: php

php:
- 5.6
- 5.5
- 5.4
- 7.0

cache:
  directories:
  - ~/.composer

before_script:
- phpenv config-add .travis.php.ini
- composer self-update
- composer install --prefer-dist

script:
- ant

branches:
  only:
  - master

## Run on container environment
sudo: false

language: php

php:
- 5.6
- 7

matrix:
  include:
    - php: 5.6
      env: dependencies=lowest
    - php: 7
      env: dependencies=lowest
    - php: 5.6
      env: dependencies=highest
    - php: 7
      env: dependencies=highest

## Cache composer bits, where possible
cache:
  directories:
    - vendor
    - $HOME/.composer/cache

before_script:
  - phpenv config-add .travis.php.ini
  - composer self-update
  - if [ -z "$dependencies" ]; then composer install; fi;
  - if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest -n; fi;
  - if [ "$dependencies" = "highest" ]; then composer update -n; fi;- composer install --prefer-dist

script:
- ant

branches:
  only:
  - master

Test only current/future PHP. Cache composer atifacts
Test only current/future PHP. Cache composer atifacts

Also testing lowest/current/highest versions of code.

* http://blog.wyrihaximus.net/2015/07/composer-cache-on-travis/
* http://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis/
