forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
96 lines (87 loc) · 2.25 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
sudo: false
dist: trusty
language: php
notifications:
email:
on_success: never
on_failure: change
cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.phpbrew
before_install:
- nvm install 6.11.1 && nvm use 6.11.1
- npm install --global npm@5
matrix:
include:
- php: 7.1
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest SWITCH_TO_PHP=5.3
- php: 7.1
env: WP_VERSION=latest SWITCH_TO_PHP=5.2
- php: 5.6
env: TRAVISCI=phpcs
- php: 7.1
env: TRAVISCI=js
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ ! -z "$WP_VERSION" ]] ; then
set -e
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
source bin/install-php-phpunit.sh
set +e
fi
- |
if [[ "$TRAVISCI" == "phpcs" ]] ; then
composer install
fi
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
# Run the build because otherwise there will be a bunch of warnings about
# failed `stat` calls from `filemtime()`.
npm install || exit 1
npm run build || exit 1
# Make sure phpegjs parser is up to date
node bin/create-php-parser.js || exit 1
if ! git diff --quiet --exit-code lib/parser.php; then
echo 'ERROR: The PEG parser has been updated, but the generated PHP version'
echo ' (lib/parser.php) has not. Run `bin/create-php-parser.js` and'
echo ' commit the resulting changes to resolve this.'
sleep .2 # Otherwise Travis doesn't want to print the whole message
exit 1
fi
echo Running with the following versions:
php -v
phpunit -v
# Check parser syntax
php lib/parser.php || exit 1
# Run PHPUnit tests
phpunit || exit 1
WP_MULTISITE=1 phpunit || exit 1
fi
- |
if [[ "$TRAVISCI" == "phpcs" ]] ; then
./vendor/bin/phpcs
fi
- |
if [[ "$TRAVISCI" == "js" ]] ; then
npm install || exit 1
npm run ci || exit 1
fi
before_deploy:
- npm install
- cd docutron
- npm install
- cd ../
- npm run docs-build
deploy:
provider: surge
project: ./docutron/build/
skip_cleanup: true
domain: gutenberg-devdoc.surge.sh