This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
83 lines (61 loc) · 1.86 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
# Config file for https://travis-ci.org/
# Validate this file here - http://lint.travis-ci.org/
# Tell Travis CI we are using PHP
language: php
# The platforms you wants to test on
dist: trusty
os:
- linux
# Install google chrome latest stable
addons:
apt:
packages:
- google-chrome-stable
# git configs
git:
depth: 1
# Define the php versions against we want to test our code
php:
- 5.6
- 7.0
matrix:
fast_finish: true
allow_failures:
- php: 7.0
# We don't want to run linux commands as super user
# false means Travis will run this in a container
sudo: false
# Disable x-debug to speed up things
before_install: phpenv config-rm xdebug.ini
# Install packages those will be required during build
install:
- composer install --no-interaction
# Prepare test environment
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
- echo "Download selenium-server-standalone jar file"
- wget -c -nc --retry-connrefused --tries=0 https://goo.gl/s4o9Vx -O selenium-server-standalone.jar
- echo "Download chrome driver and unzip it"
- wget -c -nc --retry-connrefused --tries=0 http://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip
- unzip -o -q chromedriver_linux64.zip
- echo "Run selenium server - background process"
- nohup bash -c "java -jar selenium-server-standalone.jar &" && sleep 1; cat nohup.out
- ls -al
- echo "Run php in-built server - background process"
- nohup bash -c "php -S localhost:8000 2>&1 -t app &" && sleep 1; cat nohup.out
# Run main commands
script:
- composer test
#after_script:
#after_success:
#after_failure:
# Tell Travis CI to monitor only 'master' branch
branches:
only: master
# Cache folder, you can delete cache from Travis CI web interface
cache:
directories:
- vendor
- $HOME/.composer/cache