language: php
php:
    - 5.3
    - 5.3.3
    - 5.4
    - 5.5
    - 5.6
    - 7.0
    - hhvm

env:
    - TESTER_PHP_BIN=php
    - TESTER_PHP_BIN=php-cgi

matrix:
    allow_failures:
        - php: hhvm

    exclude:
        - php: 5.3
          env: TESTER_PHP_BIN=php-cgi

        - php: hhvm
          env: TESTER_PHP_BIN=php-cgi

script:
    - src/tester -p $TESTER_PHP_BIN tests -s
    - src/tester -p $TESTER_PHP_BIN -o none tests/fail.phptx; if [ $? -eq 0 ]; then echo "tests/fail.phptx SHOULD FAIL"; exit 1; else echo "fail checked"; fi;
    - php code-checker/src/code-checker.php

after_failure:
    # Print *.actual content
    - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done

before_script:
    - travis_retry composer create-project nette/code-checker code-checker ~2.5 --no-interaction
  
sudo: false

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