forked from themeum/kirki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (67 loc) · 2.97 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
68
69
70
71
72
73
74
75
language: php
sudo: false
notifications:
on_success: never
on_failure: change
php:
- 7.0
- 5.6
before_install:
- pip install --user codecov
- composer require phpunit/phpunit:4.8.* satooshi/php-coveralls:dev-master
- composer install --dev
before_script:
- bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost latest
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction
- export PHPCS_DIR=/tmp/phpcs
- export SNIFFS_DIR=/tmp/sniffs
# Install CodeSniffer for WordPress Coding Standards checks.
- git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
# Install WordPress Coding Standards.
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR
# Install PHP Compatibility sniffs.
- git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility
# Set install path for PHPCS sniffs.
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR
# After CodeSniffer install you should refresh your path.
- phpenv rehash
# Install JSCS: JavaScript Code Style checker.
# @link http://jscs.info/
- npm install -g jscs
# Install JSHint, a JavaScript Code Quality Tool.
# @link http://jshint.com/docs/
- npm install -g jshint
# Pull in the WP Core jshint rules.
- wget https://develop.svn.wordpress.org/trunk/.jshintrc
script:
- mkdir -p build/logs
# - phpunit # --coverage-clover=coverage.clover
# Search for PHP syntax errors.
# - find . \( -name '*kirki*.php' \) -exec php -lf {} \;
# - ./vendor/bin/phpunit --coverage-clover ./tests/logs/clover.xml
# Run the plugin through JSHint.
- jshint ./controls/**/*.js
# Run the plugin through JavaScript Code Style checker.
- jscs ./controls/**/*.js
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
# -p flag: Show progress of the run.
# -s flag: Show sniff codes in all reports.
# -v flag: Print verbose output.
# -n flag: Do not print warnings. (shortcut for --warning-severity=0)
# --standard: Use WordPress as the standard.
# --extensions: Only sniff PHP files.
- $PHPCS_DIR/scripts/phpcs -p -s -v -n ./**/*kirki*.php --standard=./phpcs.ruleset.xml --extensions=php
- $PHPCS_DIR/scripts/phpcs -p -s -v -n ./**/**/*kirki*.php --standard=./phpcs.ruleset.xml --extensions=php
- $PHPCS_DIR/scripts/phpcs -p -s -v -n ./**/**/**/*kirki*.php --standard=./phpcs.ruleset.xml --extensions=php
after_script:
# - php vendor/bin/coveralls
- wget https://scrutinizer-ci.com/ocular.phar
# - php ocular.phar code-coverage:upload --format=php-clover coverage.clove
after_success:
# - coveralls
# - codecov
# - bash <(curl -s https://codecov.io/bash)