This repository has been archived by the owner on May 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
.travis.yml
74 lines (67 loc) · 2.16 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
sudo: required
language: php
php:
- 7.1
- 5.6
notifications:
irc: "irc.mozilla.org#mdndev"
matrix:
fast_finish: true
services:
- mysql
cache:
apt: true
# directories:
# - composer
addons:
apt:
packages:
- libjpeg-dev
- libpng12-dev
- php5-fpm
- php5-mysql
hosts:
- demo.dev
env:
global:
- WP_FOLDER="/home/travis/build/wordpress"
- WP_URL="http://demo.dev"
- WP_DOMAIN="demo.dev"
- DB_NAME="wordpress_unit_tests"
- WP_TABLE_PREFIX="wp_"
- WP_ADMIN_USERNAME="admin"
- WP_ADMIN_PASSWORD="admin"
matrix:
- WP_VERSION=latest
before_install:
# create the databases that will be used in the tests
- mysql -e "create database IF NOT EXISTS wordpress_unit_tests;" -uroot
# set up folders
- mkdir -p $WP_FOLDER
- mkdir tools
# install wp-cli in the `tools` folder
- wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -P $(pwd)/tools/
- chmod +x tools/wp-cli.phar && mv tools/wp-cli.phar tools/wp
# append the `tools` folder to the PATH
- export PATH=$PATH:$(pwd)/tools
# prepend the `vendor/bin` folder the PATH
- export PATH=vendor/bin:$PATH
- export PATH=composer/bin:$PATH
install:
- sed -i '30d' composer.json
- composer config github-oauth.github.com ${GH_TOKEN}
- composer global require hirak/prestissimo
- composer install --prefer-dist
# install WordPress in the `wordpress` folder
- cd $WP_FOLDER
- wp core download --version=$WP_VERSION
- wp config create --dbname="$DB_NAME" --dbuser="root" --dbpass="" --dbhost="127.0.0.1" --dbprefix="$WP_TABLE_PREFIX"
- wp core install --url="$WP_URL" --title="Promote MDN" --admin_user="$WP_ADMIN_USERNAME" --admin_password="$WP_ADMIN_PASSWORD" [email protected]
# export a dump of the just installed database to the _data folder
- wp db export $TRAVIS_BUILD_DIR/tests/_data/dump.sql
- cd /home/travis/build/
- ln -s /home/travis/build/mdn/wp-promote-mdn $WP_FOLDER/wp-content/plugins/wp-promote-mdn
- cd /home/travis/build/mdn/wp-promote-mdn
script:
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then composer require lucatume/wp-browser:2.0.* --dev; fi
- codecept run wpunit