Skip to content

Commit

Permalink
Update travis script.
Browse files Browse the repository at this point in the history
* Include PHP 7 in the matrix
* Fair use of travis/faster finish: sniff results won't change across PHP versions, so only run once.
* Fix one codestyle issue picked up by updated ruleset.
  • Loading branch information
jrfnl committed Jan 4, 2016
1 parent 15843bc commit 01349ec
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
46 changes: 31 additions & 15 deletions .travis.yml
Expand Up @@ -9,39 +9,55 @@ sudo: false
language: php

# Declare versions of PHP to use. Use one decimal max.
php:
- 5.2
- 5.6
- hhvm

# @link http://docs.travis-ci.com/user/build-configuration/
matrix:
allow_failures:
- php: hhvm
fast_finish: true

include:
# Current $required_php_version for WordPress: 5.2.4
# aliased to 5.2.17
- php: '5.2'
# aliased to a recent 5.4.x version
- php: '5.4'
# aliased to a recent 5.6.x version
- php: '5.6'
env: SNIFF=1
# aliased to a recent 7.x version
- php: '7.0'
# aliased to a recent hhvm version
- php: 'hhvm'

allow_failures:
- php: 'hhvm'

before_script:
- export PHPCS_DIR=/tmp/phpcs
- export WPCS_DIR=/tmp/wpcs
# Install CodeSniffer for WordPress Coding Standards checks.
# 2.3.1 breaks PHP 5.2 on Travis due to use of Phar class.
- git clone -b 2.3.0 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
# Install WordPress Coding Standards.
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi
# Hop into CodeSniffer directory.
- if [[ "$SNIFF" == "1" ]]; then cd $PHPCS_DIR; fi
# Set install path for WordPress Coding Standards.
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR; fi
# Hop back into project dir.
- if [[ "$SNIFF" == "1" ]]; then cd $TRAVIS_BUILD_DIR; fi
# After CodeSniffer install you should refresh your path.
- phpenv rehash
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi


# Run test script commands.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
# Search for PHP syntax errors.
- find . \( -name '*.php' \) -exec php -lf {} \;
# WordPress Coding Standards
- find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link https://github.com/squizlabs/PHP_CodeSniffer
# All of the usual config flags are held in phpcs.xml
- $PHPCS_DIR/scripts/phpcs
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs; fi

notifications:
email: false
22 changes: 12 additions & 10 deletions class-tgm-plugin-activation.php
Expand Up @@ -3147,16 +3147,18 @@ public function bulk_install( $plugins, $args = array() ) {
$this->skin->plugin_active = is_plugin_active($plugin);
*/

$result = $this->run( array(
'package' => $plugin, // [TGMPA + ] adjusted.
'destination' => WP_PLUGIN_DIR,
'clear_destination' => false, // [TGMPA + ] adjusted.
'clear_working' => true,
'is_multi' => true,
'hook_extra' => array(
'plugin' => $plugin,
),
) );
$result = $this->run(
array(
'package' => $plugin, // [TGMPA + ] adjusted.
'destination' => WP_PLUGIN_DIR,
'clear_destination' => false, // [TGMPA + ] adjusted.
'clear_working' => true,
'is_multi' => true,
'hook_extra' => array(
'plugin' => $plugin,
),
)
);

$results[ $plugin ] = $this->result;

Expand Down

0 comments on commit 01349ec

Please sign in to comment.