-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
99 lines (81 loc) · 2.87 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
dist: trusty
sudo: required
language: php
addons:
apt:
packages:
# Dependencies for Chrome.
- libappindicator1
- fonts-liberation
hosts:
- govcms8.local
branches:
except:
- master
cache:
bundler: true
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.drush/cache"
- "$HOME/.npm"
php:
- 7.1
- 7.2
matrix:
allow_failures:
- php: 7.2
fast_finish: true
before_install:
# Tweak PHP configuration.
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo 'max_execution_time = 180' >> govcms.php.ini;
- echo 'sendmail_path = /bin/true' >> govcms.php.ini;
- phpenv config-add govcms.php.ini
- phpenv config-rm xdebug.ini
- phpenv rehash
# Composer
- composer self-update
- composer --version
# Initialize xvfb (see https://docs.travis-ci.com/user/gui-and-headless-browsers)
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
# Download Chrome Driver
- LATEST_CHROMEDRIVER=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
- wget http://chromedriver.storage.googleapis.com/$LATEST_CHROMEDRIVER/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- chmod +x chromedriver
- mkdir -p $HOME/.composer/vendor/bin
- mv -f chromedriver $HOME/.composer/vendor/bin/
- rm chromedriver_linux64.zip
# Update Chrome.
- export CHROME_BIN=/usr/bin/google-chrome
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome-stable_current_amd64.deb
- rm google-chrome-stable_current_amd64.deb
- google-chrome --version
install:
# Add Composer's local bin directory to the PATH.
- export PATH="$HOME/.composer/vendor/bin:$TRAVIS_BUILD_DIR/bin:$PATH"
# composer install should fail on bad patches.
- export COMPOSER_EXIT_ON_PATCH_FAILURE=1
# Create the MySQL database and add a user for testing.
- mysql -u root -e "CREATE DATABASE govcms8; CREATE USER 'govcms'@'localhost' IDENTIFIED BY 'govcms'; GRANT ALL ON govcms8.* TO 'govcms'@'localhost';"
# Validate composer.json file.
- composer validate composer.json --no-check-all --ansi --no-interaction
# Install govCMS codes.
- travis_retry composer --verbose install
# Install govCMS site.
- phing site:install -Ddb.database=govcms8 -Ddb.user=govcms -Ddb.password=govcms -Ddb.host=127.0.0.1 -Durl==http://127.0.0.1:8080
before_script:
- drush runserver --default-server=builtin 8080 &>/dev/null &
- cd $TRAVIS_BUILD_DIR
- jdk_switcher use oraclejdk8
# Start Selenium and dump its ginormous log into a temporary file.
- mkdir tmp
- selenium-server-standalone -port 4444 -log tmp/selenium2.log &
- sleep 5
script:
- phing test:phpunit
- behat --strict --stop-on-failure --config tests/behat/behat.travis.yml