forked from WordPress/twentytwenty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (44 loc) · 1.5 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
dist: trusty
cache:
directories:
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
language:
- php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- "7.4snapshot"
matrix:
fast_finish: true
include:
- php: 7.3
env: PHPCS=1
allow_failures:
# Allow failures for unstable builds.
- php: "7.4snapshot"
before_install:
# Speed up build time by disabling Xdebug.
# @link https://johnblackbourn.com/reducing-travis-ci-build-times-for-wordpress-projects/
# @link https://twitter.com/kelunik/status/954242454676475904
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
- composer install
- npm install
script:
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- composer validate --no-check-all --strict
# Lint the PHP files against parse errors.
- composer lint
# Check the code against the standards as documented in the phpcs.xml.dist file.
- if [[ "$PHPCS" == 1 ]]; then composer checkcs; fi
# Run the theme through lint:js checker as defined in @wordpress/scripts package.
- if [[ "$PHPCS" == 1 ]]; then npm run lint:js; fi
# Run the theme through lint:css checker as defined in @wordpress/scripts package.
- if [[ "$PHPCS" == 1 ]]; then npm run lint:css; fi
# Run the theme through lint:pkg-json checker as defined in @wordpress/scripts package.
- if [[ "$PHPCS" == 1 ]]; then npm run lint:pkg-json; fi