-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
131 lines (116 loc) · 4.7 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
language: php
dist: xenial
cache:
directories:
- $HOME/.composer/cache
- jar
env:
global:
- GECKODRIVER_VERSION="0.26.0"
- FIREFOX_SELENIUM_SERVER_VERSION="3.8"
- FIREFOX_JAR_FILE="selenium-server-standalone-3.8.1.jar"
- CHROME_SELENIUM_SERVER_VERSION="3.141"
- CHROME_JAR_FILE="selenium-server-standalone-3.141.59.jar"
matrix:
include:
- php: 5.6
env: BROWSER_NAME="firefox"
addons:
firefox: latest
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 5.6
env: BROWSER_NAME="chrome"
addons:
chrome: stable
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.0
env: BROWSER_NAME="firefox"
addons:
firefox: latest
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.0
env: BROWSER_NAME="chrome"
addons:
chrome: stable
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.1
env: BROWSER_NAME="firefox"
addons:
firefox: latest
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.1
env: BROWSER_NAME="chrome"
addons:
chrome: stable
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.2
env: BROWSER_NAME="firefox"
addons:
firefox: latest
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.2
env: BROWSER_NAME="chrome"
addons:
chrome: stable
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.3
env: BROWSER_NAME="firefox"
addons:
firefox: latest
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
- php: 7.3
env: BROWSER_NAME="chrome"
addons:
chrome: stable
code_climate:
repo_token: 3cd418d30ae5fc9443ffd2cb77e19ad9e2ee06eb6fca93363262349d54bbb8d7
before_script:
- travis_retry composer update
- if [ "$BROWSER_NAME" = "firefox" -a ! -f jar/$FIREFOX_JAR_FILE ]; then
wget -q -t 3 -P jar http://selenium-release.storage.googleapis.com/$FIREFOX_SELENIUM_SERVER_VERSION/$FIREFOX_JAR_FILE;
fi
- if [ "$BROWSER_NAME" = "firefox" ]; then
wget -q -t 3 https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz;
mkdir geckodriver;
tar -xvf geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz -C geckodriver;
export PATH=$PATH:$PWD/geckodriver;
fi
- if [ "$BROWSER_NAME" = "firefox" ]; then
java -jar jar/$FIREFOX_JAR_FILE -enablePassThrough false &>> ./tests/logs/selenium.log &
fi
- if [ "$BROWSER_NAME" = "chrome" -a ! -f jar/$CHROME_JAR_FILE ]; then
wget -q -t 3 -P jar http://selenium-release.storage.googleapis.com/$CHROME_SELENIUM_SERVER_VERSION/$CHROME_JAR_FILE;
fi
- if [ "$BROWSER_NAME" = "chrome" ]; then
mkdir chromedriver;
CHROME_VERSION=$(google-chrome --product-version);
echo "Chrome version is ${CHROME_VERSION}";
wget -q -t 3 https://chromedriver.storage.googleapis.com/$(curl -L https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION%.*})/chromedriver_linux64.zip;
unzip chromedriver_linux64 -d chromedriver;
export CHROMEDRIVER_PATH=./chromedriver/chromedriver;
fi
- if [ "$BROWSER_NAME" = "chrome" ]; then
java -Dwebdriver.chrome.driver="$CHROMEDRIVER_PATH" -jar jar/$CHROME_JAR_FILE &>> ./tests/logs/selenium.log &
fi
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
- php -S 127.0.0.1:8000 -t tests/web/ &>> ./tests/logs/php-server.log &
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"
script:
- if [ "$BROWSER_NAME" = "firefox" ]; then export ENABLED_CHROME_DRIVER=""; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then export ENABLED_FIREFOX_DRIVER=""; fi
- vendor/bin/phpunit --coverage-clover ./tests/logs/coverage-clover.xml
after_success:
- vendor/bin/test-reporter --coverage-report ./tests/logs/coverage-clover.xml
- vendor/bin/coveralls -v
after_failure:
- if [ -f ./tests/logs/selenium.log ]; then cat ./tests/logs/selenium.log; fi
- if [ -f ./tests/logs/php-server.log ]; then cat ./tests/logs/php-server.log; fi