forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
169 lines (157 loc) · 7.02 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
os: linux
dist: xenial
language: generic
services:
- docker
addons:
apt:
packages:
- docker-ce
cache:
apt: true
directories:
- $HOME/.npm
- vendor
env:
global:
- LOCAL_DIR: build
- COMPOSER_INSTALL: false
- NPM_INSTALL: true
- WP_INSTALL: true
- PHP_FPM_UID: "`id -u`"
- PHP_FPM_GID: "`id -g`"
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
jobs:
include:
- env: WP_TRAVISCI=test:e2e LOCAL_PHPUNIT=latest PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
name: E2E Tests
- env: WP_TRAVISCI=lint:php COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
name: PHP Linting
- env: WP_TRAVISCI=test:compat COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
name: "PHP Compatibility Check"
- env: WP_TRAVISCI=travis:js WP_INSTALL=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
name: JS Tests
- env: LOCAL_PHP=8.0-fpm LOCAL_PHPUNIT=8.0-fpm COMPOSER_INSTALL=true WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 8.0"
script:
# The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated,
# as PHPUnit 7 is no longer supported, so run the Composer-installed PHPUnit instead.
- npm run test:php-composer -- --verbose -c phpunit.xml.dist
- npm run test:php-composer -- --verbose -c phpunit.xml.dist --group ajax
- npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml
- npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
- npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
- npm run test:php-composer -- --verbose -c phpunit.xml.dist --group restapi-jsclient
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
# Xdebug supports PHP 8 only from version 3.0, which is not released yet.
# Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.
# - LOCAL_PHP_XDEBUG=true docker-compose run --rm phpunit phpunit -v --group xdebug --exclude-group __fakegroup__
- env: LOCAL_PHP=7.4-fpm LOCAL_PHPUNIT=7.4-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.4"
- env: LOCAL_PHP=7.3-fpm LOCAL_PHPUNIT=7.3-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.3"
- env: LOCAL_PHP=7.3-fpm LOCAL_PHPUNIT=7.3-fpm LOCAL_PHP_MEMCACHED=true WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.3 with Memcached"
- env: LOCAL_PHP=7.2-fpm LOCAL_PHPUNIT=7.2-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.2"
- env: LOCAL_PHP=7.1-fpm LOCAL_PHPUNIT=7.1-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.1"
- env: LOCAL_PHP=7.0-fpm LOCAL_PHPUNIT=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.0"
- env: LOCAL_PHP=5.6-fpm LOCAL_PHPUNIT=5.6-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 5.6"
allow_failures:
fast_finish: true
before_install:
- |
if [[ "$WP_TRAVISCI" == "test:php" ]]; then
travis_retry svn checkout -r 2387243 https://plugins.svn.wordpress.org/wordpress-importer/trunk/ tests/phpunit/data/plugins/wordpress-importer
fi
- |
sudo rm /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
before_script:
- |
if [[ "$COMPOSER_INSTALL" == "true" && ${LOCAL_PHP:0:3} != "8.0" ]]; then
docker-compose run --rm php composer --version
docker-compose run --rm php composer install
elif [[ "$COMPOSER_INSTALL" == "true" && ${LOCAL_PHP:0:3} == "8.0" ]]; then
docker-compose run --rm php composer --version
docker-compose run --rm php composer install --ignore-platform-reqs
fi
- npm --version
- node --version
- nvm install --latest-npm
- |
if [[ "$NPM_INSTALL" == "true" ]]; then
npm ci
fi
- |
if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
npm run env:start
npm run build
docker-compose run --rm mysql mysql --version
docker-compose run --rm php php --version
docker-compose run --rm php php -m
fi
- |
if [[ ${LOCAL_PHP:0:3} == "8.0" ]]; then
docker-compose run --rm phpunit php ./vendor/bin/phpunit --version
elif [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
docker-compose run --rm phpunit phpunit --version
fi
- |
if [[ "$LOCAL_PHP_MEMCACHED" == "true" ]]; then
cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php
# The memcached server needs to start after `npm run env:start`, which sets up the Docker network.
docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached
fi
- |
if [[ "$WP_INSTALL" == "true" ]]; then
# Run the install process after memcached has started.
npm run env:install
fi
- npm --version
- node --version
- curl --version
- git --version
- svn --version
- php --version
- php -i
- locale -a
script:
- |
if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
npm run test:e2e
elif [[ "$WP_TRAVISCI" == "test:php" ]]; then
npm run test:php -- --verbose -c phpunit.xml.dist &&
npm run test:php -- --verbose -c phpunit.xml.dist --group ajax &&
npm run test:php -- --verbose -c tests/phpunit/multisite.xml &&
npm run test:php -- --verbose -c tests/phpunit/multisite.xml --group ms-files &&
npm run test:php -- --verbose -c phpunit.xml.dist --group external-http &&
npm run test:php -- --verbose -c phpunit.xml.dist --group restapi-jsclient &&
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__
elif [[ "$WP_TRAVISCI" == "lint:php" ]]; then
docker-compose run --rm php composer lint:errors &&
docker-compose run --rm php composer lint tests
elif [[ "$WP_TRAVISCI" == "test:compat" ]]; then
docker-compose run --rm php composer compat
else
npm run grunt $WP_TRAVISCI
fi
after_script:
- |
if [[ "$WP_TEST_REPORTER" == "true" ]]; then
git clone https://github.com/WordPress/phpunit-test-runner.git test-runner
docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
fi
notifications:
slack:
rooms:
secure: PO3x/bhYXNFqAMtzDzpOAnHcg2KzG2gGbBDft1HlqN4O8hRJqrRs7hqsEe9wKZUs6qf9Jv0ZleJ5AmcSd0DbDAFsfqeWtnWpsj8NqOIWgLX0C2idvfNRzCX1mUd6E1hlAjjTGnKn4MV3m1dRurwcDqacSBVtbXKQ+yPSgM3eXYkDz8EFbTsMcda8pFskcXr98E7/YomU0QtgOcjXndxGZ53zUQ1rfaDwUJzGY3bn5nLoweVZsSIeEFSiNcip7Kt22zVlU0SAb6QlBf3F0h9IWoRD59BQ7pkl53FWzpXoHzUYOFmn0jB5y1vHMlHvTDVEmDuumpCEqnxVvLh33AwGtqYRWH36PEfTn/u1YTFr7FS7KbwrKw9Nn+jUZe3KFrVzgQNUt0El33mO0FbSoNEWJhxRarp0D1z3/HVsbon3Fwzt/3jBHGf9nI+tHH4u7KQ70+M7pzBsV7F7Lc60YnuKrcy/hkwObGB0Za9tMHPUw3c7b4ep6nSa4ts9S++IijLWDaNAq7K/j7fAfI1JrkPIw4T6PcGpNAADkmlCrvToKE4axExaJke/lkUb+3Pwdj0h7ePzPSrHT8aASlKFM1PuI1KRMn/J4wRLtGeLlfYXvVlaQYmJobJtYgoiNWJWMIybLGVBSVPohdGO3qIJbl8WNPN1cW2ZZTcEBprLe8y7MSo=
on_failure: always
on_success: change
on_pull_requests: false