This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
executable file
·117 lines (108 loc) · 2.91 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
sudo: false
dist: trusty
env:
global:
- CC_TEST_REPORTER_ID=81fac79ba6b0198f2ca3b5db836f3837ccf1e832e77dc892f9b01719770487ed
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
language: php
notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- php: 7.2
env: WP_VERSION=latest
- php: 7.2
env: WP_VERSION=trunk
- php: 7.2
env: WP_VERSION=4.7
- php: 7.1
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=trunk
- php: 7.1
env: WP_VERSION=4.7
- php: 7.0
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=trunk
- php: 7.0
env: WP_VERSION=4.7
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk
- php: 5.6
env: WP_VERSION=4.7
- php: 7.3
env: WP_VERSION=latest
- php: 7.3
env: WP_VERSION=trunk
- php: 7.3
env: WP_VERSION=4.7
- php: nightly
env: WP_VERSION=latest
- php: nightly
env: WP_VERSION=trunk
- php: nightly
env: WP_VERSION=4.7
- php: 7.1
env: WP_TRAVISCI=phpcs
- php: 7.1
env: CODE_COVERAGE=yes
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ -z "$CODE_COVERAGE" ]] ; then
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
fi
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=4.8.*|5.7.*"
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer install --prefer-source --no-interaction --dev
vendor/bin/phpcs -i
fi
- |
if [[ ! -z "$CODE_COVERAGE" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer install --prefer-source --no-interaction --dev
mkdir -p build/logs
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
fi
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
WP_MULTISITE=1 phpunit
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
vendor/bin/phpcs
fi
- |
if [[ "$CODE_COVERAGE" == "yes" ]] ; then
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
if [ -f build/logs/clover.xml ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
fi
after_success:
- |
if [[ "$CODE_COVERAGE" == "yes" ]] ; then
travis_retry php vendor/bin/php-coveralls
fi