WordPress.org

Make WordPress Core

Changeset 40272


Ignore:
Timestamp:
03/11/2017 12:05:34 AM (4 years ago)
Author:
johnbillion
Message:

Build/Test tools: Get Travis builds working on HHVM again.

This change moves to specifying the PHPUnit version for all PHP versions, and fixes an issue where the Composer global bin directory is not at ~/.composer/vendor/bin on the boxes that are used for HHVM builds.

See #40100

Merges [40269] and [40271] to the 4.7 branch.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/.travis.yml

    r40260 r40272  
    1010matrix:
    1111  include:
    12   - php: 7
     12  - php: 7.0
    1313    env: WP_TRAVISCI=travis:js
    1414  - php: 5.2
     
    5353before_script:
    5454- |
     55  # Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
    5556  stable='^[0-9\.]+$'
    5657  if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
    5758    phpenv config-rm xdebug.ini
    5859  fi
    59 - export PATH="$HOME/.composer/vendor/bin:$PATH"
    6060- |
    61   if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
    62     composer global require "phpunit/phpunit=5.7.*"
    63   elif [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
    64     composer global require "phpunit/phpunit=4.8.*"
     61  # Export Composer's global bin dir to PATH, but not on PHP 5.2:
     62  if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
     63    composer config --list --global
     64    export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
     65  fi
     66- |
     67  # Install the specified version of PHPUnit depending on the PHP version:
     68  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
     69    case "$TRAVIS_PHP_VERSION" in
     70      7.1|7.0|hhvm|nightly)
     71        echo "Using PHPUnit 5.7"
     72        composer global require "phpunit/phpunit=5.7.*"
     73        ;;
     74      5.6|5.5|5.4|5.3)
     75        echo "Using PHPUnit 4.8"
     76        composer global require "phpunit/phpunit=4.8.*"
     77        ;;
     78      5.2)
     79        # Do nothing, use default PHPUnit 3.6.x
     80        echo "Using default PHPUnit, hopefully 3.6"
     81        ;;
     82      *)
     83        echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
     84        exit 1
     85        ;;
     86    esac
    6587  fi
    6688- npm --version
     
    7395- phpenv versions
    7496- php --version
    75 - php -m
     97- |
     98  # Debug PHP extensions, but not on HHVM because the command hangs indefinitely:
     99  if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
     100    php -m
     101  fi
    76102- npm --version
    77103- node --version
     104- which phpunit
    78105- phpunit --version
    79106- curl --version
Note: See TracChangeset for help on using the changeset viewer.