language: php

php:
  - 5.3.3
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - 7.2

dist: precise
sudo: false

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

install:
  - if [ "$TRAVIS_PHP_VERSION" == "5.3.3" ]; then composer config disable-tls true; fi
  - if [ "$TRAVIS_PHP_VERSION" == "5.3.3" ]; then composer config secure-http false; fi
  - composer install --no-interaction --prefer-source

script:
  - ./vendor/bin/tester -p php tests
  - ./parallel-lint --exclude vendor --exclude tests/examples --no-colors .
  - ./parallel-lint --exclude vendor --exclude tests/examples .
  - ./vendor/bin/phpcs --standard=phpcs-ruleset.xml -s src

before_deploy:
  - curl -LSs https://box-project.github.io/box2/installer.php | php
  - composer install --no-interaction --prefer-source --no-dev
  - composer require jakub-onderka/php-console-highlighter 0.3 --update-no-dev
  - ./box.phar build

deploy:
  provider: releases
  api_key:
    secure: THl5cW0bAohVqLzCOYJEBA6/EsmWmq05pYsWGmOyl0uIyX/2aMCwldSjfOuoDoge2CDrJfBysaPBngJtimCF4oqBOVt46hDikluGH8atgFlBb+eZEcTZWpDwIN5o6za1y5RW2G0D4U9MYLP1wwM9SLwNblGTAgTokgFni9HfTNU=
  file: parallel-lint.phar
  overwrite: true
  skip_cleanup: true
  on:
    repo: JakubOnderka/PHP-Parallel-Lint
    php: 5.6
    tags: true
