language: php

dist: xenial

php:
  - 5.6
  - 7.1
  - 7.2
  - 7.3
  - 7.4

install:
  - composer self-update
  - composer install

before_script:
  - GIT_COMMIT_SHA=$TRAVIS_PULL_REQUEST_SHA
  - GIT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
  - phpenv config-add xdebug.ini
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ~/cc-test-reporter
  - chmod a+x ~/cc-test-reporter
  - ~/cc-test-reporter before-build

script:
  - make build

after_script:
  - ~/cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
