-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
73 lines (60 loc) · 2.39 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
# Config file for https://travis-ci.org/
# Validate this file here - http://lint.travis-ci.org/
language: php
php:
- 7.0
- 7.1
matrix:
fast_finish: true
sudo: required
dist: trusty
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
before_install:
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update
- sudo apt-get install -y libappindicator1 fonts-liberation
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
- phpenv config-rm xdebug.ini
- mysql -e "create database IF NOT EXISTS larafolio;" -uroot
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('password') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
services:
- mysql
env:
- DB_HOST=127.0.0.1 DB_DATABASE=larafolio DB_USERNAME=root DB_PASSWORD=password
install:
- composer install --no-interaction
- echo "Download and Install codecept.phar"
- wget -c -nc --retry-connrefused --tries=0 http://codeception.com/releases/2.2.8/codecept.phar
- chmod +x codecept.phar
- php codecept.phar --version
before_script:
- echo "Download selenium-server-standalone jar file"
- wget -c -nc --retry-connrefused --tries=0 https://goo.gl/Lyo36k -O selenium-server-standalone.jar
- echo "Download chromedriver"
- wget -c -nc --retry-connrefused --tries=0 http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip -O chromedriver.zip
- echo "Unpack chromedriver"
- unzip chromedriver.zip
- echo "Push package resources to Laravel install"
- php artisan vendor:publish --provider="Larafolio\LarafolioServiceProvider" --force
- echo "Add user to www-data group"
- sudo -E su $USER -c 'sudo usermod -a -G www-data $USER'
- groups $USER
- echo "Run selenium server - background process"
- nohup bash -c "/usr/lib/jvm/java-8-oracle/jre/bin/java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone.jar &" && sleep 1; cat nohup.out
- echo "Run php in-built server - background process"
- nohup bash -c "php artisan serve &" && sleep 1; cat nohup.out
script:
- phpunit
- php codecept.phar run acceptance --no-interaction
cache:
directories:
- vendor
- $HOME/.composer/cache