forked from Automattic/Edit-Flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
101 lines (90 loc) · 3.15 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
dist: trusty
language: generic
services:
- docker
matrix:
include:
# Seems like Travis structures matrix builds by uniquing the `env` prop
# So adding `PHP` prop should ensure uniqueness
- php: "5.6"
env: WP_VERSION=master WP_DEV=master WP_MULTISITE=0 PHP=5.6
- php: "7.4"
env: RUN_EXTRA=1 WP_VERSION=master WP_DEV=master WP_MULTISITE=0 PHP=7.4
- php: "5.6"
env: WP_VERSION=master WP_DEV=master WP_MULTISITE=1 PHP=5.6
- php: "7.4"
env: RUN_EXTRA=1 WP_VERSION=5.4 WP_DEV=5.4.0 WP_MULTISITE=0 PHP=7.4
- php: "5.6"
env: WP_VERSION=5.4 WP_DEV=5.4.0 WP_MULTISITE=1 PHP=5.6
- php: "7.4"
env: WP_VERSION=5.4 WP_DEV=5.4.0 WP_MULTISITE=1 PHP=7.4
- php: "5.6"
env: WP_VERSION=5.4 WP_DEV=5.4.0 WP_MULTISITE=0 PHP=5.6
- php: "7.4"
env: WP_VERSION=5.4 WP_DEV=5.4.0 WP_MULTISITE=0 PHP=7.4
env:
global:
- WP_DEVELOP_DIR: ./wordpress
- INSTALL_COMPOSER: true
- INSTALL_WORDPRESS: true
- WP_VERSION: master
- WP_MULTISITE: 0
before_install:
- nvm install --latest-npm
- |
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then
# Upgrade docker-compose.
sudo rm /usr/local/bin/docker-compose
curl -sL 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
fi
install:
# Build Edit Flow.
- npm ci
- npm run build
- |
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then
# Download and unpack WordPress.
curl -sL https://github.com/WordPress/WordPress/archive/${WP_VERSION}.zip -o /tmp/wordpress-latest.zip
unzip -q /tmp/wordpress-latest.zip -d /tmp
mkdir -p wordpress/src
mv /tmp/WordPress-${WP_VERSION}/* wordpress/src
# Create the upload directory with permissions that Travis can handle.
mkdir -p wordpress/src/wp-content/uploads
chmod 767 wordpress/src/wp-content/uploads
# Grab the tools we need for WordPress' local-env.
curl -sL https://github.com/WordPress/wordpress-develop/archive/${WP_DEV}.zip -o /tmp/wordpress-develop.zip
unzip -q /tmp/wordpress-develop.zip -d /tmp
mv \
/tmp/wordpress-develop-${WP_DEV}/tools \
/tmp/wordpress-develop-${WP_DEV}/tests \
/tmp/wordpress-develop-${WP_DEV}/.env \
/tmp/wordpress-develop-${WP_DEV}/docker-compose.yml \
/tmp/wordpress-develop-${WP_DEV}/wp-cli.yml \
/tmp/wordpress-develop-${WP_DEV}/*config-sample.php \
/tmp/wordpress-develop-${WP_DEV}/package.json wordpress
# Install WordPress.
cd wordpress
chmod -R 777 .
npm install dotenv wait-on
npm run env:start
sleep 20
npm run env:install
cd ..
# Connect Edit Flow to WordPress.
npm run env connect
npm run env cli plugin activate Edit-Flow
fi
- |
if [[ "$INSTALL_COMPOSER" = "true" ]]; then
npm run env docker-run -- php composer install
fi
script:
- npm run test-unit-php
- |
if [[ ${RUN_EXTRA} == "1" ]]; then
$( npm bin )/wp-scripts test-e2e --config=./tests/e2e/jest.config.js
bash bin/phpcs-diff.sh
npm run lint
fi