-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
78 lines (67 loc) · 2.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
language: php
sudo: true
# Prevent tests from taking more than 50 minutes
group: deprecated-2017Q4
php:
- 7.2
addons:
chrome: stable
hosts:
- www.ninja.test
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
# - export USE_ZEND_ALLOC=0
- rvm use 1.9.3 --install --fuzzy
- cp .env.travis .env
install:
# install Composer dependencies
# - rm composer.lock
# these providers require referencing git commit's which cause Travis to fail
# - sed -i '/mollie/d' composer.json
# - sed -i '/2checkout/d' composer.json
- travis_retry composer install --no-interaction
before_script:
# copy configuration files
- php artisan key:generate --no-interaction
- sed -i '$a NINJA_DEV=true' .env
# create the database and user
- mysql -u root -e "create database IF NOT EXISTS ninja01;"
- mysql -u root -e "create database IF NOT EXISTS ninja02;"
- mysql -u root -e "GRANT ALL PRIVILEGES ON ninja01.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;"
- mysql -u root -e "GRANT ALL PRIVILEGES ON ninja02.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;"
# migrate and seed the database
- php artisan migrate --database=db-ninja-01 --seed --no-interaction
- php artisan migrate --database=db-ninja-02 --seed --no-interaction
- php artisan optimize
- npm install
- npm install @types/bluebird @types/[email protected]
- npm run production
# migrate and seed the database
# Start webserver on ninja.test:8000
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- ./vendor/laravel/dusk/bin/chromedriver-linux &
- php artisan serve &
script:
- php ./vendor/bin/phpunit --debug --verbose --coverage-clover=coverage.xml
- php artisan dusk
- npm test
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
email:
on_success: never
on_failure: change
slack:
invoiceninja: SLraaKBDvjeRuRtY9o3Yvp1b