forked from pronamic/wp-pay-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
113 lines (104 loc) · 3.39 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
dist: trusty
sudo: false
language: php
env:
global:
- COMPOSER_NO_INTERACTION=1
- WP_VERSION=*
jobs:
include:
# WordPress and PHP 7.4: https://make.wordpress.org/core/2019/10/11/wordpress-and-php-7-4/.
- php: 7.4
env: WP_VERSION=5.3.* COVERAGE=1 PHPCS=1 PHPSTAN=1 ESLINT=1 SASS_LINT=1
# WordPress 5.2 (or lower) will trigger PHP 7.4 (or higher) errors.
# @link https://make.wordpress.org/core/2019/10/11/wordpress-and-php-7-4/.
- php: 7.3
env: WP_VERSION=5.2.*
- php: 7.3
env: WP_VERSION=5.1.*
- php: 7.3
env: WP_VERSION=5.0.*
- php: 7.3
env: WP_VERSION=4.9.*
# WordPress 4.8 (or lower) will trigger PHP 7.2 (or higher) errors.
# @link https://make.wordpress.org/core/2018/10/15/wordpress-and-php-7-3/
# @link https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/
# @link https://make.wordpress.org/core/tag/4-9/?s=7.2
- php: 7.1
env: WP_VERSION=4.8.*
- php: 7.1
env: WP_VERSION=4.7.*
- php: 7.4
env: WP_MULTISITE=1
- php: 7.4
env: PHPMD=1
- php: 7.4
env: PSALM=1
- php: 7.3
- php: 7.2
- php: 7.1
- php: 7.0
- php: 5.6
- php: nightly
- php: hhvm
allow_failures:
- php: hhvm
- php: nightly
- env: PHPMD=1
- env: PSALM=1
cache:
directories:
- node_modules
- vendor
- $HOME/.composer/cache
before_install:
# Create database for PHPUnit tests.
- mysql -e 'CREATE DATABASE wp_phpunit_tests;'
# Remove Xdebug for a huge performance increase:
- |
if [[ "$COVERAGE" != "1" && -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]]; then
phpenv config-rm xdebug.ini
fi
# Raise PHP memory limit to 2048MB
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Validate composer.json file.
- composer validate --strict
# Add Composer global vendor/bin to path.
- export PATH="$HOME/.composer/vendor/bin:$PATH"
install:
# Install Grunt command line interface (https://github.com/gruntjs/grunt-cli).
- npm install -g grunt-cli
# Install Node.js packages.
- npm install
# Update Composer itself to the latest version (https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-).
- composer self-update
# Install Composer packages.
- composer install
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then composer bin phpstan install; fi
# Psalm
- if [ "$PSALM" == "1" ]; then composer bin psalm install; fi
# Test on specific WordPress version.
- composer require --dev --update-with-dependencies roots/wordpress:${WP_VERSION} wp-phpunit/wp-phpunit:${WP_VERSION}
# List available packages.
- composer show
script:
# ESLint
- if [ "$ESLINT" == "1" ]; then npm run-script eslint; fi
# Sass Lint
- if [ "$SASS_LINT" == "1" ]; then npm run-script sass-lint; fi
# PHPLint
- composer run-script phplint
# PHPUnit
- composer run-script phpunit
# PHP_CodeSniffer
- if [ "$PHPCS" == "1" ]; then composer run-script phpcs; fi
# PHP Mess Detector
- if [ "$PHPMD" == "1" ]; then composer run-script phpmd; fi
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then composer run-script phpstan; fi
# Psalm
- if [ "$PSALM" == "1" ]; then composer run-script psalm; fi
after_success:
- if [ "$COVERAGE" == "1" ]; then composer run-script coveralls; fi
- if [ "$COVERAGE" == "1" ]; then bash <(curl -s https://codecov.io/bash); fi