forked from Vincit/wordpress-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (42 loc) · 1.55 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
# This uses newer and faster docker based build system
sudo: false
language: php
notifications:
on_success: never
on_failure: change
php:
- nightly
- 7.0
- 5.6
env:
- WP_TEST_URL=http://localhost:12000 WP_TEST_USER=test WP_TEST_USER_PASS=test DB_USER=root DB_PASSWORD='' DB_NAME=test
matrix:
allow_failures:
- php: nightly
before_install:
- rvm install 2.2.5
before_script:
# Install composer packages before trying to activate themes or plugins
- composer install
# Create database
- mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASSWORD"
# Install router so that we don't need nginx/php-fpm
- curl -s https://raw.githubusercontent.com/Seravo/wordpress-test-template/master/lib/router.php > htdocs/router.php
# Start php server on background
- cd htdocs && php -S 0.0.0.0:12000 router.php &
# Install WordPress with wp-cli
- curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- php wp-cli.phar core install --url=$WP_TEST_URL --title='Test' --admin_user=$WP_TEST_USER --admin_password=$WP_TEST_USER_PASS --admin_email="[email protected]" --path=htdocs/wordpress
# Activate all plugins
- php wp-cli.phar plugin activate --all --path=htdocs/wordpress
# test webserver
- curl -i http://localhost:12000
# Install packages for gulp
- npm install
# Test gulp and compile assets
- ./node_modules/.bin/gulp
# Install gems for rspec tests
- gem install bundler
- bundle install --gemfile=tests/rspec/Gemfile
script:
- cd tests/rspec && bundle exec rspec *.rb