/
.travis.yml
80 lines (67 loc) · 2.71 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
language: php
cache:
directories:
- "$HOME/.composer/cache"
matrix:
include:
- php: '5.4'
env: BROWSER=goutte
- php: '5.5'
env: BROWSER=goutte
- php: '5.6'
env: BROWSER=goutte
- php: '7.0'
env: BROWSER=goutte
- php: '7.1'
env: BROWSER=goutte
- php: '7.1'
env: BROWSER=chrome
- php: '7.2'
env: BROWSER=goutte
- php: '7.2'
env: BROWSER=chrome
notifications:
slack:
rooms:
secure: "LegKwsGSAQDcqUGA8Jg90XUWfhnmho5U+RXKpuRfAT4L5Z8j761AVGIwTrUWw8gnxeGccr3smTWahm+GYuwMvg8YDxcygPuVn3U+fus0qgqAnfkQLmMl4vSdkZfO1GTc7YkyLAJcmwdDeUgXr94gQ4qvmsTSk8E0gzIstdfFiOU="
on_success: change
on_failure: always
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 2000x2000x16"
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- if [[ $TRAVIS_PHP_VERSION = hhvm* ]]; then export INI=/etc/hhvm/php.ini; else export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
- echo memory_limit = -1 >> $INI
install:
# install dependencies
- composer install --prefer-dist --no-interaction
# start php server for non php >=5.4 version
- php -S localhost:8000 -t public_html > /dev/null 2>&1 &
# start selenium and php server
- "sh -e /etc/init.d/xvfb start"
- "export DISPLAY=:99.0"
- ./bin/start-selenium > /dev/null 2>&1 &
- sleep 5
# setup database and phplist
- mkdir -p build/screenshot
- cp -f tests/travis-ci/behat.yml behat.yml
- cp -f tests/travis-ci/config.php public_html/lists/config/config.php
- cd public_html/lists/admin/ui/ && wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz
&& tar -xzf master.tar.gz && mv phplist-ui-bootlist-master phplist-ui-bootlist &&
rm master.tar.gz && cd ../../../../
- cd vendor/bin && ln -s ../njoannidi/php-lint-bash/phpLint && cd ../../
- mysql -e 'SET GLOBAL wait_timeout = 5400;'
- mysql -e 'create database phplistdb;'
- mysql -u root -e "CREATE USER 'phplist'@'localhost' IDENTIFIED BY 'phplist';"
- mysql -u root -e "GRANT ALL ON phplistdb.* TO 'phplist'@'localhost'; FLUSH PRIVILEGES;"
- sudo service mysql restart
script:
# check syntax
- ./vendor/bin/phpLint ./public_html
# run setup feature first to create database
- ./vendor/bin/behat -fprogress -p $BROWSER --strict --tags=@first-run
# run all feature except @first-run
- ./vendor/bin/behat -fprogress -p $BROWSER --strict --tags="~@first-run && ~@wip"
addons:
chrome: stable
after_failure:
- IMGUR_CLIENT_ID=bec050c54e1bb52 ./bin/imgur-uploader.sh build/screenshot/*.png