2015-01-23 22:55:02 +00:00
|
|
|
# Travis CI (MIT License) configuration file for the Underscores WordPress theme.
|
2014-08-17 16:40:13 +00:00
|
|
|
# @link https://travis-ci.org/
|
|
|
|
|
2015-01-23 22:55:02 +00:00
|
|
|
# For use with the Underscores WordPress theme.
|
2014-08-17 16:40:13 +00:00
|
|
|
# @link https://github.com/Automattic/_s
|
|
|
|
|
2020-04-14 21:18:23 +00:00
|
|
|
# Tell Travis CI which OS and which distro to use.
|
|
|
|
os: linux
|
|
|
|
dist: xenial
|
2015-12-13 14:03:43 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
# 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
|
|
|
|
|
2014-08-17 16:40:13 +00:00
|
|
|
# Declare project language.
|
2020-03-30 17:40:16 +00:00
|
|
|
# @link https://docs.travis-ci.com/user/languages/php/
|
|
|
|
language:
|
|
|
|
- php
|
|
|
|
|
|
|
|
php:
|
|
|
|
- 5.6
|
|
|
|
- 7.0
|
|
|
|
- 7.1
|
|
|
|
- 7.2
|
|
|
|
- 7.3
|
2014-08-17 16:40:13 +00:00
|
|
|
|
2020-04-14 21:18:23 +00:00
|
|
|
jobs:
|
2020-03-30 17:40:16 +00:00
|
|
|
fast_finish: true
|
|
|
|
include:
|
|
|
|
- php: 7.4
|
|
|
|
env: SNIFF=1
|
2015-12-13 14:03:43 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
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.
|
2020-04-16 21:51:18 +00:00
|
|
|
- if [[ "$SNIFF" == 1 ]]; then nvm install --lts; fi
|
2020-03-30 17:40:16 +00:00
|
|
|
# Install Composer dependencies.
|
|
|
|
- composer install
|
|
|
|
# Install NPM dependencies.
|
2020-04-16 21:51:18 +00:00
|
|
|
- if [[ "$SNIFF" == 1 ]]; then npm install; fi
|
2015-12-13 14:03:43 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
script:
|
|
|
|
# Validate the composer.json file.
|
|
|
|
# @link https://getcomposer.org/doc/03-cli.md#validate
|
|
|
|
- composer validate --no-check-all --strict
|
2014-08-17 16:40:13 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
# Search for PHP syntax errors using PHP Parallel Lint.
|
2020-04-05 22:23:06 +00:00
|
|
|
# @link https://github.com/php-parallel-lint/PHP-Parallel-Lint
|
2020-03-30 17:40:16 +00:00
|
|
|
- composer lint:php
|
2014-08-17 16:40:13 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
# Check the PHP files with the coding standards documented in the phpcs.xml.dist file.
|
|
|
|
- if [[ "$SNIFF" == 1 ]]; then composer lint:wpcs; fi
|
2014-08-17 16:40:13 +00:00
|
|
|
|
2020-03-30 17:40:16 +00:00
|
|
|
# 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
|
2014-08-17 16:40:13 +00:00
|
|
|
|
|
|
|
# Receive notifications for build results.
|
2020-03-30 17:40:16 +00:00
|
|
|
# @link https://docs.travis-ci.com/user/notifications/#configuring-email-notifications
|
2014-08-17 16:40:13 +00:00
|
|
|
notifications:
|
2015-12-13 14:03:43 +00:00
|
|
|
email: false
|