forked from mirror/_s
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
# 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.
|
|
- nvm install --lts
|
|
# Install Composer dependencies.
|
|
- composer install
|
|
# Install NPM dependencies.
|
|
- npm install
|
|
|
|
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
|