Travis.yml的简约内容失败了吗? [英] Travis.yml failing with minimalistic contents?
问题描述
我的Github上有当前的travis.yml
:
I have the current travis.yml
on my 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并没有最好的信息..这是我日志的最后几块:
All my jobs keep failing, but with a minimalistic build, i Cannot see why it fails.. As Travis doesn't exactly have the best information.. Here is the last few chunks of my logs:
职位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.
和Job 9.2:
相同并且以:
The command "phpunit" exited with 2.
Done. Your build exited with 1.
那么,这里出了什么问题?
So, what is going wrong here?
推荐答案
使用Travis运行的脚本的任何非零退出代码均被视为失败.
您的简约.travis.yml
没有指定构建脚本,因此将运行PHP的默认构建脚本,即phpunit
(
Any non-zero exit code of the scripts you run with Travis are considered a failure.
Your minimalistic .travis.yml
does not specify a build script, therefore the default build script for PHP is run, which is phpunit
(see also the documentation).
由于您的存储库中没有phpunit.xml,因此Travis基本上没有任何运行.这会导致构建失败.
As you don't have a phpunit.xml in your repository, there is basically nothing to run for Travis. This leads to the failing build.
这实际上取决于您要使用Travis做什么,但是您可以根据默认配置存储库,或者定义一个脚本来在运行这样的构建时执行:
It really depends what you want to do with Travis, but either you configure your repository according to the default or define a script to execute when running the build like this:
language: php
php:
- 5.4
- 5.5
script: ./build.sh
然后,您可以在运行构建时在build.sh
中指定要执行的任何内容.
Then you can specify whatever you want in the build.sh
to be executed when running build.
您可能需要确保./build.sh
是可执行文件,而您可以使用
You may need to insure that ./build.sh
is executable which you can do with
before_install:
- chmod +x build.sh
您还可以将脚本制作为bash build.sh
或sh build.sh
.
You can also make the script bash build.sh
or sh build.sh
.
这篇关于Travis.yml的简约内容失败了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!