This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
/
.travis.yml
executable file
·104 lines (94 loc) · 2.34 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
100
101
102
103
104
language: php
notifications:
email:
on_success: never
on_failure: change
cache:
directories:
- $HOME/.composer/cache
services:
- mysql
matrix:
include:
- php: 7.4snapshot
env: WP_VERSION=latest PHPUNIT_VERSION=7.5.17
- php: 7.3
env: WP_VERSION=latest
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk
- php: 5.6
env: WP_TRAVISCI=lint
- php: 7.3
env: WP_TRAVISCI=test-js
- php: 7.3
env: WP_TRAVISCI=test-e2e
# Make sure NodeGit gets the correct C libs, copied from Gutenberg.
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.9-dev
before_install:
- |
if [[ "$WP_TRAVISCI" == "test-e2e" ]] ; then
# Upgrade docker-compose, copied from Gutenberg.
sudo rm /usr/local/bin/docker-compose
curl -sL https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Linux-x86_64 > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
fi
install:
- composer install
- nvm install --lts
- npm install
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
if [[ -z "$PHPUNIT_VERSION" ]] ; then
PHPUNIT_VERSION=5.7.9
fi
composer global require "phpunit/phpunit=$PHPUNIT_VERSION"
fi
- |
if [[ "$WP_TRAVISCI" == "lint" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
npm run lint:js
fi
script:
- npm run build
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
WP_MULTISITE=1 phpunit
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs
fi
- |
if [[ "$WP_TRAVISCI" == "test-js" ]] ; then
npm run test:js
fi
- |
if [[ "$WP_TRAVISCI" == "test-e2e" ]] ; then
npm run env start
npm run test:e2e
fi