language: php php: - 7.0 sudo: false env: matrix: - DB=mysql - DB=pgsql - DB=sqlite cache: directories: - vendor - $HOME/.composer/cache before_install: - travis_retry composer self-update && composer --version #travis is bad at updating composer - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; install: - mkdir -p data/config - | if [[ "$DB" == "pgsql" ]]; then psql -c "SELECT set_config('log_statement', 'all', false);" -U postgres ; psql -c "CREATE DATABASE shimmie;" -U postgres ; echo ' data/config/auto_install.conf.php ; fi - | if [[ "$DB" == "mysql" ]]; then mysql -e "SET GLOBAL general_log = 'ON';" -uroot ; mysql -e "CREATE DATABASE shimmie;" -uroot ; echo ' data/config/auto_install.conf.php ; fi - if [[ "$DB" == "sqlite" ]]; then echo ' data/config/auto_install.conf.php ; fi - composer install - php index.php script: - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=data/coverage.clover after_failure: - head -n 100 data/config/* - ls /var/run/mysql* # All of the below commands require sudo, which we can't use without losing some speed & caching. # SEE: https://docs.travis-ci.com/user/workers/container-based-infrastructure/ # - ls /var/log/*mysql* # - cat /var/log/mysql.err # - cat /var/log/mysql.log # - cat /var/log/mysql/error.log # - cat /var/log/mysql/slow.log # - ls /var/log/postgresql # - cat /var/log/postgresql/postgresql* after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover data/coverage.clover