-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
82 lines (76 loc) · 2.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
language: php
services:
- mysql
env:
global:
- WP_DB_USER=wp
- WP_DB_PASS=password
- WP_DB_NAME=wp_tests
matrix:
fast_finish: true
include:
- &lint
php: 7.3
script:
- npm run lint
env: JOB_NAME=lint
- &test
php: 7.3
script:
- mysql -u root -e "GRANT ALL PRIVILEGES ON ${WP_DB_NAME}.* TO ${WP_DB_USER} IDENTIFIED BY '${WP_DB_PASS}';"
- mysql -u root -e "CREATE DATABASE ${WP_DB_NAME};"
- npm run test-only
env: JOB_NAME=test
- <<: *test
env: JOB_NAME=test WP_VERSION=master
- <<: *test
env: JOB_NAME=coverage
- <<: *test
php: 7.2
- <<: *test
php: 7.1
- <<: *test
php: 7.0
- <<: *test
php: 5.6
env: JOB_NAME=test ADDITIONAL_COMPOSER_OPTIONS="--prefer-lowest"
- <<: *test
php: 5.5
env: JOB_NAME=test ADDITIONAL_COMPOSER_OPTIONS="--prefer-lowest"
- <<: *test
php: 5.4
env: JOB_NAME=test ADDITIONAL_COMPOSER_OPTIONS="--prefer-lowest"
- <<: *test
php: 5.4
env: JOB_NAME=test ADDITIONAL_COMPOSER_OPTIONS="--prefer-lowest"
allow_failures:
- <<: *test
env: JOB_NAME=test WP_VERSION=master
cache:
directories:
- $HOME/.npm
- node_modules
- $HOME/.composer/cache
- vendor
before_install:
- if [[ $JOB_NAME != "coverage" ]]; then phpenv config-rm xdebug.ini || true; fi
- travis_retry npm install -g npm@latest
- node -v
- npm -v
- travis_retry composer self-update
- php -v
- composer --version
install:
- travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest $ADDITIONAL_COMPOSER_OPTIONS;
- if [[ -n "$WP_VERSION" ]]; then
cd vendor/wordpress/wordpress;
git checkout $WP_VERSION;
cd ../../../;
fi
- travis_retry npm ci
after_success:
- if [[ $JOB_NAME == "coverage" ]]; then
travis_retry wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar;
chmod +x php-coveralls.phar;
travis_retry ./php-coveralls.phar -x coverage/phpunit/logs/clover.xml -o ./coverage/coverage.json -v;
fi