This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
.travis.yml
92 lines (84 loc) · 2.31 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
language: php
dist: xenial
services:
- mysql
cache:
directories:
- $HOME/.composer/cache
php:
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
# Compatibility policy:
#
# - WordPress: latest -1
# - WooCommerce: latest -2
env:
- WP_VERSION=5.3 WC_VERSION=4.0
- WP_VERSION=5.3 WC_VERSION=3.9
- WP_VERSION=5.3 WC_VERSION=3.8
- WP_VERSION=5.2 WC_VERSION=4.0
- WP_VERSION=5.2 WC_VERSION=3.9
- WP_VERSION=5.2 WC_VERSION=3.8
matrix:
fast_finish: true
include:
- name: Coding Standards
php: 7.3
env: WP_VERSION=latest WC_VERSION=latest RUN_PHPCS=1
- name: Code Coverage
php: 7.3
env: WP_VERSION=latest WC_VERSION=latest RUN_CODE_COVERAGE=1
- name: Bleeding Edge
php: 7.4
env: WP_VERSION=trunk WC_VERSION=latest
exclude:
- php: 7.4
env: WP_VERSION=5.2 WC_VERSION=4.0
- php: 7.4
env: WP_VERSION=5.2 WC_VERSION=3.9
- php: 7.4
env: WP_VERSION=5.2 WC_VERSION=3.8
allow_failures:
- name: Code Coverage
- name: Bleeding Edge
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.0/coveralls.phar
chmod +x coveralls.phar
mkdir -p build/logs
fi
- phpenv config-rm xdebug.ini || true
- |
if [[ ${GITHUB_AUTH_TOKEN} != '' ]]; then
composer config -g github-oauth.github.com $GITHUB_AUTH_TOKEN
fi
- | # Install WordPress + WooCommerce unless we're just checking coding standards.
if [[ -z ${RUN_PHPCS} ]]; then
bash tests/bin/install-wp-tests.sh woocommerce_test root '' localhost $WP_VERSION
bash tests/bin/install-woocommerce.sh $WC_VERSION
fi
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then
composer update --prefer-source --prefer-lowest --no-interaction --no-ansi
else
composer install --prefer-source --no-interaction --no-ansi
fi
script:
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
phpdbg -qrr -d memory_limit=-1 ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=build/logs/clover.xml --exclude-group=timeout
elif [[ ${RUN_PHPCS} ]]; then
./vendor/bin/phpcs
else
./vendor/bin/phpunit
fi
after_success:
- |
if [[ ${RUN_CODE_COVERAGE} ]]; then
travis_retry php coveralls.phar
fi