sudo: false

language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4snapshot
  - nightly

matrix:
  allow_failures:
    - php: 7.4snapshot
    - php: nightly
  fast_finish: true

install:
  # --ignore-platform-reqs, because https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2722
  - composer update -n --prefer-dist

  - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
  - chmod +x php-coveralls.phar

  - mkdir -p coverage/cov coverage/bin
  - wget https://phar.phpunit.de/phpcov.phar -O coverage/bin/phpcov
  - chmod +x coverage/bin/phpcov

  - composer show

script:
  - AMPHP_TEST_REDIS_INSTANCE=tcp://localhost:6379 phpdbg -qrr vendor/bin/phpunit --verbose --coverage-php coverage/cov/main.cov
  - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix

after_script:
  - coverage/bin/phpcov merge --clover build/logs/clover.xml coverage/cov
  - travis_retry ./php-coveralls.phar -v

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.php-cs-fixer
    - $HOME/.local

sudo: false

language: php

php:
  - 7.1
  - 7.2
  - 7.3
  - 7.4snapshot
  - nightly

services:
  - redis-server

matrix:
  allow_failures:
    - php: 7.4snapshot
    - php: nightly
  fast_finish: true

install:
  # --ignore-platform-reqs, because https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/2722
  - composer update -n --prefer-dist

  - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
  - chmod +x php-coveralls.phar

  - mkdir -p coverage/cov coverage/bin
  - wget https://phar.phpunit.de/phpcov.phar -O coverage/bin/phpcov
  - chmod +x coverage/bin/phpcov

  - composer show

script:
  - AMPHP_TEST_REDIS_INSTANCE=tcp://localhost:6379 phpdbg -qrr vendor/bin/phpunit --verbose --coverage-php coverage/cov/main.cov
  - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix

after_script:
  - coverage/bin/phpcov merge --clover build/logs/clover.xml coverage/cov
  - travis_retry ./php-coveralls.phar -v

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.php-cs-fixer
    - $HOME/.local

Use redis service on Travis
Use redis service on Travis
