detain/db_abstraction

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php
os: linux
dist: trusty

env:

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0
  - 7.1
  - 7.2

cache:
  directories:
    - $HOME/.composer/cache/files
    - tmp/pear/download/
    - vendor/
    - composer.lock

addons:
  code_climate:
    repo_token: $CODECLIMATE_REPO_TOKEN

services:
  - mysql
  - postgresql

before_install:
  - mkdir -p build/logs
  - if [[ "${TRAVIS_PHP_VERSION:0:1}" == "7" ]] || [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then phpenv config-rm xdebug.ini; fi
  - phpenv rehash
  - sh -c "psql -c 'DROP DATABASE IF EXISTS tests;' -U postgres"
  - sh -c "psql -c 'DROP DATABASE IF EXISTS tests2;' -U postgres"
  - sh -c "psql -c 'CREATE DATABASE tests;' -U postgres"
  - sh -c "psql -c 'CREATE DATABASE tests2;' -U postgres"

install:
  - travis_retry composer selfupdate
  - travis_retry composer install --no-interaction --prefer-source --ansi -o -v

before_script:
  - psql tests < tests/psql.sql
  - mysql --default-character-set=utf8mb4 < tests/mysql.sql
  - sqlite3 tests.db ".read tests/sqlite.sql"

script:
  - if [[ "${TRAVIS_PHP_VERSION:0:1}" == "7" ]]; then PGDBUSER=postgres PGDBHOST=localhost PGDBNAME=tests DBUSER=tests DBPASS=tests DBHOST=localhost DBNAME=tests phpdbg -qrr vendor/bin/phpunit -c phpunit.xml.dist --testsuite "all tests"; fi;
  - if [[ "${TRAVIS_PHP_VERSION:0:1}" != "7" ]]; then PGDBUSER=postgres PGDBHOST=localhost PGDBNAME=tests DBUSER=tests DBPASS=tests DBHOST=localhost DBNAME=tests vendor/bin/phpunit -c phpunit.xml.dist --testsuite "all tests"; fi

after_script:
  - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then travis_retry vendor/bin/test-reporter --coverage-report=coverage.xml; fi
  - travis_retry bash <(curl -s https://codecov.io/bash);
  - travis_retry php $(ls vendor/bin/*coveralls|head -n 1) -v -x coverage.xml
  - travis_retry php vendor/bin/codacycoverage clover coverage.xml;