forked from cross-solution/YAWIK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
94 lines (81 loc) · 2.68 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
language: php
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
services:
- mongodb
cache:
directories:
- "$HOME/.composer/cache"
- "$HOME/.npm"
# hello world
matrix:
fast_finish: true
allow_failures:
- php: 7.2
env: INTEGRATION=yes
- php: 7.2
env: COVERAGE=yes
- php: 7.3
include:
- php: 5.6
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.2
env: COVERAGE=yes
- php: 7.2
env: INTEGRATION=yes
if: repo=cross-solution/YAWIK AND branch=~ /(master|develop)/ AND type NOT IN (pull_request)
before_install:
- node --version
# remove xdebug when not collecting code coverage
- if [[ $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi;
- pecl channel-update pecl.php.net
before_script:
# add composer's global bin directory to the path
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# copy default app config
- mkdir -p config/autoload
- mkdir -p build/behat
- mkdir -p build/mails
- cp ./etc/travis/autoload/*.* config/autoload
# install Mongo extension
- php --ri mongodb || pecl install -f mongodb
- phpenv config-add etc/travis/phpenv.ini
- composer install --prefer-dist --no-interaction
# TODO: remove this line when composer auto-scripts automatically executed
- composer run auto-scripts
# setup display, behat, and selenium
- ./bin/start-selenium > /dev/null 2>&1 &
- sleep 5
- composer run serve --timeout=0 > /dev/null 2>&1 &
script:
- 'if [[ $COVERAGE = yes ]]; then
./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml --coverage-php=build/logs/clover.serialized;
else
./vendor/bin/phpunit --verbose;
fi'
- if [[ $COVERAGE != yes ]]; then ./vendor/bin/behat --strict --no-interaction; fi;
# run integration job
- 'if [[ $INTEGRATION = yes ]]; then
etc/travis/bin/split.sh;
etc/travis/bin/integration.sh;
fi'
after_failure:
- cd $TRAVIS_BUILD_DIR
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"build/behat/*.log\""
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/*.log\""
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/tracy/*.*\""
- "IMGUR_CLIENT_ID=bec050c54e1bb52 ./bin/imgur-uploader build/behat/*.png"
after_script:
# process coverage
- 'if [[ $COVERAGE = yes ]]; then
composer require php-coveralls/php-coveralls --no-scripts;
travis_retry vendor/bin/php-coveralls -vvv;
wget https://scrutinizer-ci.com/ocular.phar;
travis_retry ocular.phar code-coverage:upload --format=php-clover build/logs/clover.serialized;
fi'