language: php

dist: xenial

php:
  - 7.4
  - 8.0

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
