/
.travis.yml
50 lines (44 loc) · 1.33 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
os: linux
dist: xenial
language: php
cache:
yarn: true
directories:
- vendor
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
branches:
only:
- master
- develop
- /^release\/\d+\.\d+(\.\d+)?(-\S*)?$/
- /^hotfix\/\d+\.\d+(\.\d+)?(-\S*)?$/
jobs:
fast_finish: true
include:
- php: 7.4
env: CHECKJS=1 PHPUNIT=1 TRAVIS_NODE_VERSION=node
- php: 5.6
env: PHPUNIT=1
- php: 7.0
env: PHPUNIT=1
- php: 8.0
env: PHPUNIT=1
before_install:
- if [[ "$CHECKJS" == "1" ]]; then nvm install $TRAVIS_NODE_VERSION; fi
- if [[ "$CHECKJS" == "1" ]]; then curl -o- -L https://yarnpkg.com/install.sh | bash; fi
- if [[ "$CHECKJS" == "1" ]]; then export PATH=$HOME/.yarn/bin:$PATH; fi
install:
- |
if [[ ${TRAVIS_PHP_VERSION:0:1} == "8" || $TRAVIS_PHP_VERSION == "nightly" ]]; then
travis_retry composer update yoast/wp-test-utils --with-dependencies --no-interaction --ignore-platform-reqs
else
travis_retry composer install --no-interaction
fi
- if [[ "$CHECKJS" == "1" ]]; then yarn global add grunt-cli; fi
- if [[ "$CHECKJS" == "1" ]]; then yarn install; fi
script:
- if [[ "$CHECKJS" == "1" ]]; then grunt check; fi
- if [[ "$PHPUNIT" == "1" ]]; then composer test; fi