-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy path.travis.yml
97 lines (83 loc) · 2.2 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
language: php
cache:
directories:
- vendor
- $HOME/.composer/cache
# Specify multiple parallel jobs to run in two ways
# See docs for more info: https://docs.travis-ci.com/user/build-matrix/
# 1. Let Travis automatically create a matrix of all combinations of PHP versions
# (the ones listed under `php`), and environments (listed under `env`) and test
# against all those combinations.
# Test main supported versions of PHP against latest WP.
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
services:
- mysql
# Different stages in order to only deploy when everything succeeds
stages:
- test
- name: deploy
if: branch = master
env:
- WP_VERSION=latest
# 2. Also test against these combinations, as listed out explicitly one by one
# Additional tests against stable PHP (min recommended version is 5.6) and past supported versions of WP
# and code coverage report.
matrix:
fast_finish: true
include:
# - php: 5.2
# dist: precise
# stage: test
# - php: 5.3
# dist: precise
# stage: test
- name: "Coding standard check"
php: 7.2
env: WP_VERSION=latest RUN_PHPCS=1
stage: test
- php: 7.3
env: WP_VERSION=latest
stage: test
- name: "PHP 7.3 unit tests using WordPress nightly"
php: 7.3
env: WP_VERSION=nightly
stage: test
- name: "Deployment to Pressable"
stage: deploy
env: SHOULD_DEPLOY=1
addons:
ssh_known_hosts: sftp.pressable.com
apt:
packages:
- lftp
install:
- npm ci
# The Composer install command should work for all versions of PHP. However, there is a chance it could
# fail for PHP 5.6 in the future. If we see that then we can use this script to delete composer.lock,
# remove any packages causing issues with `composer remove --dev` and try the install again.
before_script:
- |
if [[ $SHOULD_DEPLOY != 1 ]]; then
composer install
bash ./bin/install-wp-tests.sh woocommerce_test root '' localhost $WP_VERSION false
fi
script:
- bash bin/phpunit.sh
- bash bin/phpcs.sh
- npm run lint
- npm test
deploy:
provider: script
script: bash bin/deploy-to-test-site.sh
skip_cleanup: true
on:
branch: master
condition: $SHOULD_DEPLOY = 1
branches:
only:
- master