forked from acquia/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (86 loc) · 3.09 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
sudo: required
dist: trusty
language: php
cache:
bundler: true
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.drush/cache"
- "$HOME/.npm"
php:
- 5.6
env:
- VERSION=HEAD
- VERSION=1.13
- VERSION=1.12
- VERSION=1.11
- VERSION=1.10
addons:
apt:
packages:
# Dependencies for Chrome.
- libappindicator1
- fonts-liberation
before_install:
- phpenv config-rm xdebug.ini
- 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 so that we will be running
# our installed versions of Drush, PHPCS, Behat, PhantomJS, etc.
- 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 drupal; CREATE USER 'lightning'@'localhost' IDENTIFIED BY 'lightning'; GRANT ALL ON drupal.* TO 'lightning'@'localhost';"
# PHP conf tweaks
- echo 'max_execution_time = 120' >> drupal.php.ini;
- echo 'sendmail_path = /bin/true' >> drupal.php.ini;
- phpenv config-add drupal.php.ini
- phpenv rehash
# We need Phing to execute our build steps.
- composer global require phing/phing
# Build the Lightning code base.
- composer install
# Install Lightning cleanly so that settings.php will be created properly.
- phing install -Ddb.database=drupal -Ddb.user=lightning -Ddb.password=lightning -Ddb.host=127.0.0.1
# Import the fixture, if it exists.
- phing remember -Dversion=$VERSION -Ddb.database=drupal -Ddb.user=lightning -Ddb.password=lightning -Ddb.host=127.0.0.1
- cd docroot
- drush cache-rebuild
# Install Lightning Preview, if it isn't already.
- drush pm-enable --yes lightning_preview
# Execute database updates, if there are any.
- drush updatedb --yes
before_script:
- drush runserver --default-server=builtin 8080 &>/dev/null &
- 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
- cd ./profiles/lightning
script:
- composer validate --no-check-all --ansi
- behat --strict --stop-on-failure
matrix:
fast_finish: true