Make WordPress Core

Changeset 40274


Ignore:
Timestamp:
03/11/2017 12:13:53 AM (8 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.5 branch.

Location:
branches/4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/.travis.yml

    r40266 r40274  
    66matrix:
    77  include:
    8   - php: 5.5
     8  - php: 7.0
    99    env: WP_TRAVISCI=travis:js
    1010  - php: 5.2
     
    4949before_script:
    5050- |
     51  # Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
    5152  stable='^[0-9\.]+$'
    5253  if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
    5354    phpenv config-rm xdebug.ini
    5455  fi
    55 - export PATH="$HOME/.composer/vendor/bin:$PATH"
    5656- |
    57   if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
    58     composer global require "phpunit/phpunit=5.7.*"
    59   elif [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
    60     composer global require "phpunit/phpunit=4.8.*"
     57  # Export Composer's global bin dir to PATH, but not on PHP 5.2:
     58  if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
     59    composer config --list --global
     60    export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
     61  fi
     62- |
     63  # Install the specified version of PHPUnit depending on the PHP version:
     64  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
     65    case "$TRAVIS_PHP_VERSION" in
     66      7.1|7.0|hhvm|nightly)
     67        echo "Using PHPUnit 5.7"
     68        composer global require "phpunit/phpunit=5.7.*"
     69        ;;
     70      5.6|5.5|5.4|5.3)
     71        echo "Using PHPUnit 4.8"
     72        composer global require "phpunit/phpunit=4.8.*"
     73        ;;
     74      5.2)
     75        # Do nothing, use default PHPUnit 3.6.x
     76        echo "Using default PHPUnit, hopefully 3.6"
     77        ;;
     78      *)
     79        echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
     80        exit 1
     81        ;;
     82    esac
    6183  fi
    6284- npm --version
     
    6991- phpenv versions
    7092- php --version
    71 - php -m
     93- |
     94  # Debug PHP extensions, but not on HHVM because the command hangs indefinitely:
     95  if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
     96    php -m
     97  fi
    7298- npm --version
    7399- node --version
     100- which phpunit
    74101- phpunit --version
    75102- curl --version
Note: See TracChangeset for help on using the changeset viewer.