forked from DiscipleTools/disciple-tools-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
53 lines (50 loc) · 1.57 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
language: php
dist: xenial
node_js:
- '10'
sudo: required # this seems to be required for some reason to get MySQL to work
services:
- mysql
cache:
directories:
- "node_modules"
- $HOME/.composer/cache
- $HOME/.composer/cache/files
matrix:
include:
- php: 8.0
- php: 7.2
env: WP_VERSION=latest
before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS testdb'
- mysql -e "GRANT ALL ON testdb.* TO 'travis'@'localhost'"
- nvm install 10.16.3
- nvm use 10.16.3
- npm install -g gulp-cli eslint@4 babel-eslint
- npm install
before_script:
- composer install
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash tests/install-wp-tests.sh wordpress_test root '' localhost latest
fi
script:
- ./tests/test_for_syntax_errors.sh
- ./tests/test_installation.sh
- ./tests/test_phpcs.sh
- ./tests/test_eslint.sh
- find dt-assets/ -iname "*.min.js" -or -iname "*.map" -or -iname "*.min.css" -delete && rm -rf build/
- gulp
- git diff --exit-code -- . ':(exclude)package-lock.json'
# If the previous command returns a non-zero exit code, that means gulp has
# modified some files in version control. This shouldn't happen, developers
# should remember to run gulp before committing. (We're excluding
# package-lock.json, as changes can be caused merely by a different version
# of npm.)
- |
if [[ ! -z "$WP_VERSION" ]] ; then
composer require "phpunit/phpunit=7.5.*"
vendor/phpunit/phpunit/phpunit --version
WP_MULTISITE=1 vendor/phpunit/phpunit/phpunit
fi