2016-02-17 16:47:46 +01:00
|
|
|
language: php
|
|
|
|
|
2016-02-18 12:42:07 +01:00
|
|
|
sudo: true
|
2016-02-17 16:47:46 +01:00
|
|
|
|
|
|
|
php:
|
2016-02-18 10:13:35 +01:00
|
|
|
- 5.5
|
2016-02-18 18:31:22 +01:00
|
|
|
# - 5.6
|
|
|
|
# - 7.0
|
|
|
|
# - hhvm
|
2016-02-17 16:47:46 +01:00
|
|
|
|
2016-02-18 11:20:43 +01:00
|
|
|
addons:
|
|
|
|
hosts:
|
2016-02-18 11:26:21 +01:00
|
|
|
- ninja.dev
|
2016-02-18 11:20:43 +01:00
|
|
|
|
2016-02-17 16:47:46 +01:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- vendor
|
|
|
|
- $HOME/.composer/cache
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- COMPOSER_DISCARD_CHANGES=true
|
|
|
|
- COMPOSER_NO_INTERACTION=1
|
|
|
|
- COMPOSER_DISABLE_XDEBUG_WARN=1
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
# set GitHub token and update composer
|
|
|
|
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
|
|
|
|
- composer self-update && composer -V
|
|
|
|
|
|
|
|
install:
|
|
|
|
# install Composer dependencies
|
2016-02-17 20:28:36 +01:00
|
|
|
- rm composer.lock
|
2016-02-17 20:34:29 +01:00
|
|
|
# these providers require referencing git commit's which cause Travis to fail
|
2016-02-17 18:46:10 +01:00
|
|
|
- sed -i '/mollie/d' composer.json
|
|
|
|
- sed -i '/2checkout/d' composer.json
|
2016-02-17 17:49:40 +01:00
|
|
|
- travis_retry composer install --prefer-dist;
|
2016-02-17 16:47:46 +01:00
|
|
|
|
|
|
|
before_script:
|
2016-02-18 19:46:28 +01:00
|
|
|
# prevent MySQL went away error
|
2016-02-18 15:59:50 +01:00
|
|
|
- mysql -u root -e 'SET @@GLOBAL.wait_timeout=28800;'
|
2016-02-17 16:47:46 +01:00
|
|
|
# copy configuration files
|
2016-02-17 20:17:06 +01:00
|
|
|
- cp .env.example .env
|
2016-02-17 16:47:46 +01:00
|
|
|
- cp tests/_bootstrap.php.default tests/_bootstrap.php
|
2016-02-17 21:17:55 +01:00
|
|
|
- php artisan key:generate --no-interaction
|
2016-02-17 21:32:26 +01:00
|
|
|
- sed -i 's/APP_ENV=production/APP_ENV=development/g' .env
|
2016-02-17 21:49:34 +01:00
|
|
|
- sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env
|
2016-02-18 18:00:21 +01:00
|
|
|
- sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env
|
2016-02-17 16:47:46 +01:00
|
|
|
# create the database and user
|
|
|
|
- mysql -u root -e "create database IF NOT EXISTS ninja;"
|
|
|
|
- mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;"
|
|
|
|
# migrate and seed the database
|
|
|
|
- php artisan migrate --no-interaction
|
|
|
|
- php artisan db:seed --no-interaction # default seed
|
|
|
|
- php artisan db:seed --no-interaction --class=UserTableSeeder # development seed
|
|
|
|
# Start webserver on ninja.dev:8000
|
2016-02-22 20:58:16 +01:00
|
|
|
- php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background
|
2016-02-17 16:47:46 +01:00
|
|
|
# Start PhantomJS
|
2016-02-18 12:36:47 +01:00
|
|
|
- phantomjs --webdriver=4444 & # '&' allows to run in background
|
2016-02-17 16:47:46 +01:00
|
|
|
# Give it some time to start
|
|
|
|
- sleep 5
|
2016-02-18 10:21:23 +01:00
|
|
|
# Make sure the app is up-to-date
|
2016-02-22 20:58:16 +01:00
|
|
|
- curl -L http://ninja.dev:8000/update
|
2016-02-17 16:47:46 +01:00
|
|
|
|
|
|
|
script:
|
2016-02-26 13:36:48 +01:00
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php
|
2016-02-26 10:47:39 +01:00
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php
|
2016-02-26 13:36:48 +01:00
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php
|
|
|
|
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php
|
2016-02-19 09:56:48 +01:00
|
|
|
|
2016-02-21 14:26:27 +01:00
|
|
|
#- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env
|
|
|
|
#- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php
|
2016-02-17 16:47:46 +01:00
|
|
|
|
2016-02-17 21:42:31 +01:00
|
|
|
after_script:
|
2016-02-21 11:28:41 +01:00
|
|
|
- cat .env
|
|
|
|
- mysql -u root -e 'select * from accounts;' ninja
|
2016-02-21 11:15:27 +01:00
|
|
|
- mysql -u root -e 'select * from account_gateways;' ninja
|
2016-02-21 11:28:41 +01:00
|
|
|
- mysql -u root -e 'select * from clients;' ninja
|
|
|
|
- mysql -u root -e 'select * from invoices;' ninja
|
|
|
|
- mysql -u root -e 'select * from invoice_items;' ninja
|
2016-02-18 14:46:21 +01:00
|
|
|
- cat storage/logs/laravel.log
|
2016-02-17 21:42:31 +01:00
|
|
|
|
2016-02-17 16:47:46 +01:00
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
on_success: never
|
|
|
|
on_failure: change
|