forked from understrap/understrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (58 loc) · 2.05 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
# Travis CI configuration file.
# @link https://travis-ci.org/
# For use with the UnderStrap WordPress theme
# @link https://github.com/understrap/understrap
# Declare virtual environment and operating system.
# @link https://docs.travis-ci.com/user/reference/overview/#virtualization-environments
os: linux
dist: xenial
# Declare project language and PHP versions to test against.
# @link https://docs.travis-ci.com/user/languages/php/
language: php
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- nightly
matrix:
fast_finish: true
include:
- php: 7.4
env: PHPCS=1
allow_failures:
- php: nightly
# Use this to prepare the build for testing.
before_script:
# Speed up build time by disabling Xdebug.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# Install composer dependencies
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then
composer install;
else
composer install --ignore-platform-reqs;
fi
# Install JSCS: JavaScript Code Style checker
# @link http://jscs.info/
- if [[ "$PHPCS" == 1 ]]; then npm install -g jscs; fi
# Install JSHint, a JavaScript Code Quality Tool
# @link https://jshint.com/docs/
- if [[ "$PHPCS" == 1 ]]; then npm install -g jshint; fi
- if [[ "$PHPCS" == 1 ]]; then wget https://develop.svn.wordpress.org/trunk/.jshintrc; fi
# Run test script commands.
# Default is specific to project language.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- if [[ "$PHPCS" == 1 ]]; then composer validate --no-check-all --strict; fi
# Lint the PHP files against parse errors.
- composer lint:php
# Check the code against the standards as documented in the phpcs.xml file.
- if [[ "$PHPCS" == 1 ]]; then composer check:cs; fi
# Run the theme through JSHint
- if [[ "$PHPCS" == 1 ]]; then jshint .; fi
# Run the theme through JavaScript Code Style checker
- if [[ "$PHPCS" == 1 ]]; then jscs .; fi