language: php

php:
  - 7.1
  - 7.0
  - 5.6

env:
  - ADAPTER=MemoryStore
  - ADAPTER=Apc
  - ADAPTER=Memcached
  - ADAPTER=Redis
  - ADAPTER=Couchbase
  - ADAPTER=MySQL
  - ADAPTER=SQLite
  - ADAPTER=PostgreSQL
  - ADAPTER=Flysystem

services:
  - docker

before_install:
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
  - if [ -f $HOME/docker/$(phpenv version-name).tar ]; then docker load < $HOME/docker/$(phpenv version-name).tar; fi

install:
  - make up PHP=$(phpenv version-name) ADAPTER=${ADAPTER}
  - docker save $(phpenv version-name) > $HOME/docker/$(phpenv version-name).tar

script:
  - sleep 10
  - make test PHP=$(phpenv version-name) ADAPTER=${ADAPTER} UP=0 DOWN=0

after_success:
  - docker-compose exec $(phpenv version-name) /bin/bash <(curl -s https://codecov.io/bash)

after_script:
  - make down PHP=$(phpenv version-name) ADAPTER=${ADAPTER}

matrix:
  fast_finish: true

cache:
  directories:
    - $HOME/docker

language: php

php:
  - 7.1
  - 7.0
  - 5.6

env:
  - ADAPTER=MemoryStore
  - ADAPTER=Apc
  - ADAPTER=Memcached
  - ADAPTER=Redis
  - ADAPTER=Couchbase
  - ADAPTER=MySQL
  - ADAPTER=SQLite
  - ADAPTER=PostgreSQL
  - ADAPTER=Flysystem

services:
  - docker

before_install:
  - sudo apt-get update
  - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce

install:
  - make up PHP=$(phpenv version-name) ADAPTER=${ADAPTER}

script:
  - sleep 60
  - make test PHP=$(phpenv version-name) ADAPTER=${ADAPTER} UP=0 DOWN=0

after_success:
  - docker-compose exec $(phpenv version-name) /bin/bash <(curl -s https://codecov.io/bash)

after_script:
  - make down PHP=$(phpenv version-name) ADAPTER=${ADAPTER}

matrix:
  fast_finish: true

Stop caching Docker images in Travis
Stop caching Docker images in Travis

And increase time to wait after spinning up services
