This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/.travis.yml
2015-09-20 20:03:29 +01:00

48 lines
1.8 KiB
YAML

language: php
sudo: false
php:
# Here is where we can list the versions of PHP you want to test against
# using major version aliases
- 5.4
- 5.5
- 5.6
- nightly
# optionally specify a list of environments, for example to test different RDBMS
env:
- DB=mysql
- DB=pgsql
- DB=sqlite
install:
# Enable logging of all queries (for debugging) and create the database schema for shimmie.
- mkdir -p data/config
- if [[ "$DB" == "pgsql" ]]; then psql -c "SELECT set_config('log_statement', 'all', false);" -U postgres; fi
- if [[ "$DB" == "pgsql" ]]; then psql -c "CREATE DATABASE shimmie;" -U postgres; fi
- if [[ "$DB" == "pgsql" ]]; then echo '<?php define("DATABASE_DSN", "pgsql:user=postgres;password=;host=;dbname=shimmie");' > data/config/auto_install.conf.php ; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "SET GLOBAL general_log = 'ON';" -uroot; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "CREATE DATABASE shimmie;" -uroot; fi
- if [[ "$DB" == "mysql" ]]; then echo '<?php define("DATABASE_DSN", "mysql:user=root;password=;host=localhost;dbname=shimmie");' > data/config/auto_install.conf.php ; fi
- if [[ "$DB" == "sqlite" ]]; then echo '<?php define("DATABASE_DSN", "sqlite:shimmie.sqlite");' > data/config/auto_install.conf.php ; fi
script:
- php install.php
- phpunit --configuration tests/phpunit.xml
# If a failure occured then dump out a bunch of logs for debugging purposes.
after_failure:
- head -n 100 data/config/*
- ls /var/run/mysql*
- 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*
# configure notifications (email, IRC, campfire etc)
#notifications:
# irc: "irc.freenode.org#shimmie"
#