Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update travis script. #502

Merged
merged 1 commit into from
Jan 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
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:/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https:/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
# Install WordPress Coding Standards.
- git clone -b master --depth 1 https:/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https:/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:/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:/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link https:/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
Original file line number Diff line number Diff line change
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