Update Travis CI build configuration
authorOri Livneh <ori@wikimedia.org>
Thu, 19 Jun 2014 03:22:26 +0000 (20:22 -0700)
committerBryanDavis <bdavis@wikimedia.org>
Thu, 19 Jun 2014 22:18:14 +0000 (22:18 +0000)
* Target 'hhvm-nightly', not 'hhvm'.
* Don't target Zend PHP versions other than 5.3.
  There is value in targetting different versions of the PHP interpreter, but
  in the short term there is more benefit to be had from targetting just HHVM
  and PHP 5.3 (results are produced more quickly and are easier to interpret).
* Don't update submodules manually; Travis does that by default if there is a
  .gitmodules file in the repository root.
  <http://docs.travis-ci.com/user/build-configuration/#Git-Submodules>
* Update Composer before installing PHPUnit.
* Make the wiki name and dbname agree.
* Allow Composer to install whatever is specified in composer.json, rather than
  hard-coding an install of PHPUnit 3.7 (3.7 is incompatible with HHVM).
* Ping freenode#mediawiki-core with the test results, but only when the build
  status changes. We can turn it off if it gets annoying.
* Don't hack include_path or date.timezone ini settings; those were kludges
  needed to get HHVM to run at all at, but they're no longer needed.
* Invoke hhvm via 'php'; Travis ensures that it points to the target
  interpreter.

Verified on my personal fork:
 <https://travis-ci.org/atdt/mediawiki-core/builds/27983653>

Change-Id: I442b40e0d3e31d3cbd963e1219578842f4564004

.travis.yml

index e0a45a1..4e03068 100644 (file)
@@ -9,18 +9,8 @@
 language: php
 
 php:
-  - hhvm
+  - hhvm-nightly
   - 5.3
-  - 5.4
-  - 5.5
-  - 5.6
-
-matrix:
-  allow_failures:
-    - php: 5.3
-    - php: 5.4
-    - php: 5.5
-    - php: 5.6
 
 services:
   - mysql
@@ -33,16 +23,12 @@ branches:
 
 before_install:
   - sudo apt-get install -qq djvulibre-bin tidy
+  - composer self-update --quiet --no-interaction
 
 before_script:
-  # Initialise submodules, in case we're testing a Wikimedia production branch.
-  - git submodule update --init --recursive
-  # Travis CI's HHVM environment provides PHPUnit as a phar file, but
-  # MediaWiki's test suite only works if individual PHPUnit files are
-  # actual files on disk (bug 58881).
-  - composer require 'phpunit/phpunit=3.7.*' --prefer-source
+  - composer install --prefer-source --quiet --no-interaction
   - >
-      php maintenance/install.php testwiki admin
+      php maintenance/install.php traviswiki admin
       --pass travis
       --dbname traviswiki
       --dbuser travis
@@ -50,14 +36,12 @@ before_script:
       --scriptpath "/w"
 
 script:
-  - >
-      if [ "$TRAVIS_PHP_VERSION" = "hhvm" ];
-      then
-        hhvm --php \
-        -d include_path=".$(printf ':%s' vendor/phpunit/*)" \
-        -d date.timezone="Etc/UTC" \
-        tests/phpunit/phpunit.php
-      else
-        php tests/phpunit/phpunit.php \
-        --with-phpunitdir ./vendor/phpunit/phpunit
-      fi
+  - php tests/phpunit/phpunit.php
+
+notifications:
+  irc:
+    channels:
+      - "chat.freenode.net#mediawiki-core"
+    on_success: change
+    on_failure: change
+    skip_join: true