-
Notifications
You must be signed in to change notification settings - Fork 17
/
.travis.yml
126 lines (107 loc) · 3.36 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
cache:
directories:
- $HOME/.composer/cache
- $HOME/.jest-cache
- $HOME/.npm
- $HOME/.nvm/.cache
- $HOME/phpunit-bin
notifications:
email:
on_success: never
on_failure: change
webhooks: https://coveralls.io/webhook
language: php
dist: xenial
services:
- mysql
- docker
addons:
apt:
packages:
- libxml2-utils
branches:
only:
- master
- develop
- /^\d+\.\d+$/
env:
global:
- COVERALLS_PARALLEL=true
# Ensure Xdebug v3 coverage reporting is available.
- XDEBUG_MODE=coverage
before_install:
- nvm install
- nvm use
install:
- npm install
- export DEV_LIB_PATH=vendor/xwp/wp-dev-lib/scripts
- export DIFF_HEAD=HEAD
- source "$DEV_LIB_PATH/travis.install.sh"
before_script:
- phpenv config-rm xdebug.ini || echo "xdebug.ini does not exist."
script:
- source "$DEV_LIB_PATH/travis.script.sh"
after_script:
- source "$DEV_LIB_PATH/travis.after_script.sh"
jobs:
fast_finish: true
include:
- stage: lint
name: Lint (PHP, JavaScript, and configuration files)
php: "7.4"
env: WP_VERSION=latest DEV_LIB_ONLY=xmllint,phpsyntax,composer
script:
- source "$DEV_LIB_PATH/travis.script.sh"
- npm run lint
- stage: test
name: E2E tests with Docker (7.4, WordPress latest, with code coverage)
php: "7.4"
env: NODE_ENV=e2e
install:
- sudo service mysql stop
- npm install
- docker-compose pull
before_script:
- echo "Running E2E tests with code coverage ..."
script:
- npm run env:start
- npm run wp -- bash -c "while ! nc -z mysql 3306; do sleep 1; done"
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password [email protected] --skip-email --url=http://localhost:8088 --quiet
- npm run wp -- wp plugin activate foo-bar
- npm run build:js
- npm run test:e2e:coveralls
after_script:
- echo "E2E tests complete"
- name: JS unit tests (7.4, WordPress latest, with code coverage)
php: "7.4"
env: WP_VERSION=latest
install:
- sudo service mysql stop
- npm install
before_script:
- echo "Running JS unit tests with code coverage ..."
script:
- npm run build:js
- npm run test:js:coveralls
after_script:
- echo "JS unit tests complete"
- name: PHP unit tests (7.4, WordPress latest, with code coverage)
php: "7.4"
env: WP_VERSION=latest DEV_LIB_ONLY=phpunit,coverage,composer
before_script:
- echo "Running PHP unit tests with code coverage ..."
- name: PHP unit tests (7.4, WordPress trunk)
php: "7.4"
env: WP_VERSION=trunk DEV_LIB_ONLY=phpunit,composer
- name: PHP unit tests (5.6, WordPress latest)
php: "5.6"
env: WP_VERSION=latest DEV_LIB_ONLY=phpunit,composer
before_script:
- composer config --unset platform.php
- composer require --dev phpunit/phpunit:^5 phpunit/phpcov php-coveralls/php-coveralls --update-with-dependencies
- name: PHP unit tests (5.6, WordPress 5.0)
php: "5.6"
env: WP_VERSION=5.0 DEV_LIB_ONLY=phpunit,composer
before_script:
- composer config --unset platform.php
- composer require --dev phpunit/phpunit:^5 phpunit/phpcov php-coveralls/php-coveralls --update-with-dependencies