5

travis.yml私はGithubに最新のものを持っています:

# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php

# list any PHP version you want to test against
php:
  # aliased to a recent 5.4.x version
  - 5.4
  # aliased to a recent 5.5.x version
  - 5.5

私の仕事はすべて失敗し続けますが、最小限のビルドでは、なぜ失敗するのかわかりません.Travisは正確に最良の情報を持っていないため..ログの最後のいくつかのチャンクは次のとおりです。

ジョブ 9.1:

$ git clone --depth=50 --branch=master git://github.com/SlayerSolutions/Authentication.git SlayerSolutions/Authentication

Cloning into 'SlayerSolutions/Authentication'...

remote: Counting objects: 128, done.

remote: Compressing objects: 100% (104/104), done.

remote: Total 128 (delta 55), reused 83 (delta 15)

Receiving objects: 100% (128/128), 19.17 KiB | 0 bytes/s, done.

Resolving deltas: 100% (55/55), done.

$ cd SlayerSolutions/Authentication
git.2

$ git checkout -qf 1df78d018dbe8a81e66490e90012229adcff7af8

$ phpenv global 5.4

$ php --version

PHP 5.4.16 (cli) (built: Jun 28 2013 11:14:20)

Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

$ composer --version

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.4.16/bin/composer.phar self-update" to get the latest version.

Composer version 7755564962718189d5d7d9fdee595283c8f032b7

$ phpunit

PHPUnit 3.7.21 by Sebastian Bergmann.

Usage: phpunit [switches] UnitTest [UnitTest.php]

phpunit [switches] <directory>

--log-junit <file> Log test execution in JUnit XML format to file.
 ...Bla,bla,bla

The command "phpunit" exited with 2.

Done. Your build exited with 1.

ジョブ 9.2:

同じで、次で終わります:

The command "phpunit" exited with 2.

Done. Your build exited with 1.

それで、ここで何がうまくいかないのですか?

4

1 に答える 1

13

Travis で実行するスクリプトのゼロ以外の終了コードは、失敗と見なされます。ミニマル.travis.ymlではビルド スクリプトが指定されていないため、PHP のデフォルトのビルド スクリプトが実行されますphpunit(ドキュメントも参照してください)。

リポジトリに phpunit.xml がないため、基本的に Travis に対して実行するものは何もありません。これにより、ビルドが失敗します。

Travis で何をしたいかによって異なりますが、デフォルトに従ってリポジトリを構成するか、次のようにビルドを実行するときに実行するスクリプトを定義します。

language: php

php:
  - 5.4
  - 5.5

script: ./build.sh

build.sh次に、ビルドの実行時に実行する必要があるものを指定できます。

./build.shあなたができる実行可能であることを保証する必要があるかもしれません

before_install:
  - chmod +x build.sh

スクリプトbash build.shまたはsh build.sh.

于 2013-08-15T07:50:46.033 に答える