suitmedia/suitcoda

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php


sudo: false


php:
  - 5.5
  - 5.6
  - 7.0


sudo: false


env:
  matrix:
    - DB_CONNECTION=mysql DB_DATABASE=suitcoda_test DB_HOST=127.0.0.1 DB_USERNAME=travis
    - DB_CONNECTION=pgsql DB_DATABASE=suitcoda_test DB_HOST=127.0.0.1 DB_USERNAME=travis
  global:
    - DEFAULT=1
    - SETUP=BASIC
    - DB_CONNECTION=mysql
    - DB_DATABASE=suitcoda_test
    - DB_HOST=127.0.0.1
    - DB_USERNAME=travis


matrix:
  fast_finish: true

  include:
    - php: 5.5
      env: SETUP=STABLE

    - php: 5.5
      env: SETUP=LOWEST

    - php: 5.6
      env: SETUP=STABLE

    - php: 5.6
      env: SETUP=LOWEST

    - php: 5.5.9
      env: COVERALLS=1

    - php: 7.0
      env: PHPCS=1

    - php: hhvm
      env: HHVM=1 DB_CONNECTION=pgsql DB_DATABASE=suitcoda_test DB_HOST=127.0.0.1 DB_USERNAME=travis

    - php: hhvm
      env: HHVM=1

  allow_failures:
    - env: COVERALLS=1
    - php: hhvm


before_script:
  - cp .env.travis .env
  - composer self-update

  - if [[ $SETUP != 'BASIC' ]]; then git config --global core.filemode false; fi
  - travis_retry composer install --no-interaction --prefer-source
  - if [[ $SETUP = 'STABLE' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-stable; fi
  - if [[ $SETUP = 'LOWEST' ]]; then travis_retry composer update --prefer-source --no-interaction --prefer-lowest --prefer-stable; fi

  - php artisan key:generate

  - if [[ $DB_CONNECTION = 'mysql' ]]; then mysql -e 'CREATE DATABASE suitcoda_test;'; fi
  - if [[ $DB_CONNECTION = 'pgsql' ]]; then psql -c 'CREATE DATABASE suitcoda_test;' -U postgres; fi

  - if [[ $COVERALLS = '1' ]]; then mkdir -p build/logs; fi

  - php artisan migrate
  - php artisan db:seed

  - phpenv rehash
  - set +H


script:
  - if [[ $DEFAULT = '1' ]]; then vendor/bin/phpunit; fi
  - if [[ $PHPCS = '1' ]]; then vendor/bin/phpcs -p --extensions=php --standard=PSR2 ./app ./tests; fi

  - if [[ $COVERALLS = '1' ]]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi


after_script:
  - if [[ $COVERALLS = '1' ]]; then bash <(curl -s https://codecov.io/bash); fi


notifications:
  email: false