This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
186 lines (166 loc) · 8.12 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
language: php
dist: xenial
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
env:
global:
- DISPLAY=:99.0
- BROWSER_NAME="htmlunit"
- SELENIUM_SERVER="https://selenium-release.storage.googleapis.com/3.14/selenium-server-standalone-3.14.0.jar" # Latest version including HtmlUnit
services:
- xvfb
matrix:
include:
# Codestyle check build
- name: 'Code style and static analysis'
php: '7.4'
env: CHECK_CODESTYLE=1
before_install:
- phpenv config-rm xdebug.ini
before_script: ~
script:
- composer require phpstan/phpstan # Not part of require-dev, because it won't install on PHP 5.6
- composer analyze
- composer codestyle:check
after_script: ~
after_success: ~
# Build with lowest possible dependencies on lowest possible PHP
- name: 'Lowest dependencies build'
php: '5.6'
env: DEPENDENCIES="--prefer-lowest"
# Firefox inside Travis environment
- name: 'Firefox 45 on Travis (OSS protocol); via legacy Selenium server'
php: '7.3'
env:
- BROWSER_NAME="firefox"
- SELENIUM_SERVER="legacy"
addons:
firefox: "45.8.0esr"
# Firefox with Geckodriver (W3C mode) inside Travis environment
- name: 'Firefox latest on Travis (W3C protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="firefox"
- GECKODRIVER="1"
addons:
firefox: latest
# Stable Chrome + Chromedriver (W3C mode) inside Travis environment via Selenium server proxy
- name: 'Chrome stable on Travis (W3C protocol); via Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
addons:
chrome: stable
# Stable Chrome + Chromedriver (W3C mode) inside Travis environment directly via Chromedriver
- name: 'Chrome stable on Travis (W3C protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
- CHROMEDRIVER="1"
addons:
chrome: stable
# Stable Chrome + Chromedriver (JsonWire OSS mode) inside Travis environment directly via Chromedriver
- name: 'Chrome stable on Travis (OSS protocol); no Selenium server'
php: '7.3'
env:
- BROWSER_NAME="chrome"
- CHROMEDRIVER="1"
- DISABLE_W3C_PROTOCOL="1"
addons:
chrome: stable
# Saucelabs builds
- name: 'Sauce Labs, Firefox 47, OSS protocol'
php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="firefox" VERSION="47.0" PLATFORM="Windows 10" DISABLE_W3C_PROTOCOL="1"
before_script:
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./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"
addons:
sauce_connect: true
jwt:
secure: HPq5xFhosa1eSGnaRdJzeyEuaE0mhRlG1gf3G7+dKS0VniF30husSyrxZhbGCCKBGxmIySoAQzd43BCwL69EkUEVKDN87Cpid1Ce9KrSfU3cnN8XIb+4QINyy7x1a47RUAfaaOEx53TrW0ShalvjD+ZwDE8LrgagSox6KQ+nQLE=
- name: 'Sauce Labs, Chrome 74, OSS protocol'
php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="chrome" VERSION="74.0" PLATFORM="Windows 10" DISABLE_W3C_PROTOCOL="1" # 74 is the last version which don't use W3C WebDriver by default
before_script:
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./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"
addons:
sauce_connect: true
jwt:
secure: HPq5xFhosa1eSGnaRdJzeyEuaE0mhRlG1gf3G7+dKS0VniF30husSyrxZhbGCCKBGxmIySoAQzd43BCwL69EkUEVKDN87Cpid1Ce9KrSfU3cnN8XIb+4QINyy7x1a47RUAfaaOEx53TrW0ShalvjD+ZwDE8LrgagSox6KQ+nQLE=
- name: 'Sauce Labs, Chrome latest, W3C protocol'
php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="chrome" VERSION="latest" PLATFORM="Windows 10"
before_script:
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./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"
addons:
sauce_connect: true
jwt:
secure: HPq5xFhosa1eSGnaRdJzeyEuaE0mhRlG1gf3G7+dKS0VniF30husSyrxZhbGCCKBGxmIySoAQzd43BCwL69EkUEVKDN87Cpid1Ce9KrSfU3cnN8XIb+4QINyy7x1a47RUAfaaOEx53TrW0ShalvjD+ZwDE8LrgagSox6KQ+nQLE=
- name: 'Sauce Labs, Edge latest, W3C protocol'
php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="MicrosoftEdge" VERSION="latest" PLATFORM="Windows 10"
before_script:
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./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"
addons:
sauce_connect: true
jwt:
secure: HPq5xFhosa1eSGnaRdJzeyEuaE0mhRlG1gf3G7+dKS0VniF30husSyrxZhbGCCKBGxmIySoAQzd43BCwL69EkUEVKDN87Cpid1Ce9KrSfU3cnN8XIb+4QINyy7x1a47RUAfaaOEx53TrW0ShalvjD+ZwDE8LrgagSox6KQ+nQLE=
cache:
directories:
- $HOME/.composer/cache
install:
- travis_retry composer self-update
- travis_retry composer update --no-interaction $DEPENDENCIES
before_script:
- if [ "$BROWSER_NAME" = "chrome" ]; then
mkdir chromedriver;
CHROME_VERSION=$(google-chrome --product-version);
CHROME_VERSION=${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.zip -d chromedriver;
fi
- if [ "$BROWSER_NAME" = "chrome" ]; then export CHROMEDRIVER_PATH=$PWD/chromedriver/chromedriver; fi
- if [ "$GECKODRIVER" = "1" ]; then mkdir -p geckodriver; wget -q -t 3 https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz; tar xzf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver; fi
- if [ ! -f jar/selenium-server-standalone.jar ] && [ -n "$SELENIUM_SERVER" ]; then
mkdir -p jar;
if [ "$SELENIUM_SERVER" = "legacy" ]; then
wget -q -t 3 -O jar/selenium-server-standalone.jar https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar;
else
wget -q -t 3 -O jar/selenium-server-standalone.jar $SELENIUM_SERVER;
fi
fi
- if [ "$GECKODRIVER" = "1" ]; then
geckodriver/geckodriver &> ./logs/geckodriver.log &
elif [ "$CHROMEDRIVER" = "1" ]; then
chromedriver/chromedriver --port=4444 --url-base=/wd/hub &> ./logs/chromedriver.log &
elif [ "$SELENIUM_SERVER" = "legacy" ]; then
java -Dwebdriver.firefox.marionette=false -Dwebdriver.chrome.driver="$PWD/chromedriver/chromedriver" -jar jar/selenium-server-standalone.jar -enablePassThrough false -log ./logs/selenium.log &
else
java -Dwebdriver.chrome.driver="$PWD/chromedriver/chromedriver" -Dwebdriver.gecko.driver="$PWD/geckodriver/geckodriver" -jar jar/selenium-server-standalone.jar -log ./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/functional/web/ &>>./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 [ -n "$SAUCELABS" ]; then EXCLUDE_GROUP+="exclude-saucelabs,"; fi
- if [ "$BROWSER_NAME" = "MicrosoftEdge" ]; then EXCLUDE_GROUP+="exclude-edge,"; fi
- if [ "$BROWSER_NAME" = "firefox" ]; then EXCLUDE_GROUP+="exclude-firefox,"; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then EXCLUDE_GROUP+="exclude-chrome,"; fi
- if [ -n "$EXCLUDE_GROUP" ]; then EXTRA_PARAMS+=" --exclude-group $EXCLUDE_GROUP"; fi
- ./vendor/bin/phpunit --coverage-clover ./logs/coverage-clover.xml $EXTRA_PARAMS
after_script:
- if [ -f ./logs/selenium.log ]; then cat ./logs/selenium.log; fi
- if [ -f ./logs/php-server.log ]; then cat ./logs/php-server.log; fi
- if [ -f ./logs/geckodriver.log ]; then cat ./logs/geckodriver.log; fi
- if [ -f ./logs/chromedriver.log ]; then cat ./logs/chromedriver.log; fi
after_success:
- travis_retry php vendor/bin/php-coveralls -v