language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - 7.2
  - nightly
  - hhvm

# faster builds on new travis setup not using sudo
sudo: false

# travis does not support HHVM on other platforms, choosing trusty
dist: trusty

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

# run build against hhvm but allow them to fail
# http://docs.travis-ci.com/user/build-configuration/#Rows-That-are-Allowed-To-Fail
matrix:
  fast_finish: true
  allow_failures:
    - php: nightly

install:
  - composer self-update && composer --version
  - composer install --prefer-dist

script:
  - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover
# test against standard markdown spec
#  - git clone https://github.com/jgm/stmd && cd stmd && perl runtests.pl spec.txt ../bin/markdown

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
