forked from Automattic/_s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (58 loc) · 2.08 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
# Travis CI (MIT License) configuration file for the Underscores WordPress theme.
# @link https://travis-ci.org/
# For use with the Underscores WordPress theme.
# @link https://github.com/Automattic/_s
# Tell Travis CI which OS and which distro to use.
os: linux
dist: xenial
# Cache directories between builds.
# @link https://docs.travis-ci.com/user/caching/#arbitrary-directories
cache:
directories:
# Cache directory for npm.
- $HOME/.npm
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
# Declare project language.
# @link https://docs.travis-ci.com/user/languages/php/
language:
- php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
jobs:
fast_finish: true
include:
- php: 7.4
env: SNIFF=1
before_install:
# Speed up build time by disabling Xdebug.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# Download and install the latest long-term support release of node.
- if [[ "$SNIFF" == 1 ]]; then nvm install --lts; fi
# Install Composer dependencies.
- composer install
# Install NPM dependencies.
- if [[ "$SNIFF" == 1 ]]; then npm install; fi
script:
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- composer validate --no-check-all --strict
# Search for PHP syntax errors using PHP Parallel Lint.
# @link https://github.com/php-parallel-lint/PHP-Parallel-Lint
- composer lint:php
# Check the PHP files with the coding standards documented in the phpcs.xml.dist file.
- if [[ "$SNIFF" == 1 ]]; then composer lint:wpcs; fi
# Check the JS files with the lint-js script defined in the @wordpress/scripts package.
- if [[ "$SNIFF" == 1 ]]; then npm run lint:js; fi
# Check the SCSS files with the lint-style script defined in the @wordpress/scripts package.
- if [[ "$SNIFF" == 1 ]]; then npm run lint:scss; fi
# Receive notifications for build results.
# @link https://docs.travis-ci.com/user/notifications/#configuring-email-notifications
notifications:
email: false