---
language: php
php:
  - 5.6
  - 7.0
  - 7.1
  - nightly

addons:
    postgresql: "9.6"
    code_climate:
        repo_token: $CODECLIMATE_API_TOKEN

services:
  - postgresql
  - redis-server

cache:
  directories:
    - node_modules
    - ~/.composer/cache

sudo: false
dist: trusty

notifications:
  slack: mentedigital:duwI9LzVAI2ZgDbtie5vwpR7
  slack: projetodoesangue:n3fh7tZf7ZtGAiqzQPlIypiI

install: composer install

before_script:
  - psql -c 'create database doesangue_test;' -U postgres
#  - travis_retry composer install --no-interaction --prefer-source --dev
#  - pip install --user codecov
  - composer require codeclimate/php-test-reporter --dev

script:
  - php artisan migrate --env=testing --no-interaction
#  - php artisan db:seed --env=testing --no-interaction
#  - vendor/bin/phpunit --coverage-clover=coverage.xml
  - vendor/bin/phpunit --debug
  - sh ./cache-clean.sh

after_success:
  - bash <(curl -s https://codecov.io/bash)
  - vendor/bin/test-reporter

before_deploy: "echo 'Booting the deploy to heroku'"

deploy:
  provider: heroku
  api_key: $HEROKU_AUTH_TOKEN
  app: doesangueapi
  on:
    branch: development
    php: 7.0
  run: "git rm -r --cached vendor/"
  skip_cleanup: true

---
language: php
php:
  - 5.6
  - 7.0
  - 7.1
  - nightly

addons:
    postgresql: "9.6"
    code_climate:
        repo_token: $CODECLIMATE_API_TOKEN

services:
  - postgresql
  - redis-server

cache:
  directories:
    - node_modules
    - ~/.composer/cache

sudo: false
dist: trusty

notifications:
  slack: mentedigital:duwI9LzVAI2ZgDbtie5vwpR7
  slack: projetodoesangue:n3fh7tZf7ZtGAiqzQPlIypiI

install: composer install

before_script:
  - psql -c 'create database doesangue_test;' -U postgres
#  - travis_retry composer install --no-interaction --prefer-source --dev
#  - pip install --user codecov
  - composer require codeclimate/php-test-reporter --dev

script:
  - php artisan migrate --env=testing --no-interaction
#  - php artisan db:seed --env=testing --no-interaction
#  - vendor/bin/phpunit --coverage-clover=coverage.xml
  - vendor/bin/phpunit --debug
  - sh ./cache-clean.sh

after_success:
  - bash <(curl -s https://codecov.io/bash)
  - vendor/bin/test-reporter

Remove heroku deploy and set it in heroku
:green_heart: Remove heroku deploy and set it in heroku
