forked from php-webdriver/php-webdriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
125 lines (108 loc) · 5.38 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
language: php
sudo: false
dist: trusty
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
env:
global:
- DISPLAY=:99.0
- BROWSER_NAME="htmlunit"
matrix:
include:
# Codestyle check build
- php: '7.3'
env: CHECK_CODESTYLE=1
before_install:
- phpenv config-rm xdebug.ini
before_script: ~
script:
- composer require phpstan/phpstan-shim # 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
- php: '5.6'
env: DEPENDENCIES="--prefer-lowest"
# Firefox inside Travis environment
- php: '7.3'
env: BROWSER_NAME="firefox"
addons:
firefox: "45.8.0esr"
# Stable Chrome + Chromedriver 74 inside Travis environment
- php: '7.3'
env: BROWSER_NAME="chrome" CHROME_HEADLESS="1" CHROMEDRIVER_VERSION="74.0.3729.6"
addons:
chrome: stable
# Stable Chrome + Chromedriver 75+ inside Travis environment
- php: '7.3'
env: BROWSER_NAME="chrome" CHROME_HEADLESS="1" CHROMEDRIVER_VERSION="75.0.3770.8"
addons:
chrome: stable
# Saucelabs builds
- php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="firefox" VERSION="47.0" 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=
- php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="chrome" VERSION="74.0" PLATFORM="Windows 10" # 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=
- php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="chrome" VERSION="75.0" 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=
- php: '7.3'
env: SAUCELABS=1 BROWSER_NAME="MicrosoftEdge" VERSION="16.16299" 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
- jar
install:
- travis_retry composer self-update
- travis_retry composer update --no-interaction $DEPENDENCIES
before_script:
- if [ "$BROWSER_NAME" = "chrome" ]; then mkdir chromedriver; wget -q -t 3 https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip; unzip chromedriver_linux64 -d chromedriver; fi
- if [ "$BROWSER_NAME" = "chrome" ]; then export CHROMEDRIVER_PATH=$PWD/chromedriver/chromedriver; fi
- sh -e /etc/init.d/xvfb start
- if [ ! -f jar/selenium-server-standalone-3.8.1.jar ]; then wget -q -t 3 -P jar https://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar; fi
- java -Dwebdriver.firefox.marionette=false -Dwebdriver.chrome.driver="$CHROMEDRIVER_PATH" -jar jar/selenium-server-standalone-3.8.1.jar -enablePassThrough false -log ./logs/selenium.log &
- 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 [ -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
after_success:
- travis_retry php vendor/bin/php-coveralls -v