Travis.yml failing with minimalistic contents? - github

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
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:
Job 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.
and Job 9.2:
Is the same and ends with:
The command "phpunit" exited with 2.
Done. Your build exited with 1.
So, what is going wrong here?

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).
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.
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
Then you can specify whatever you want in the build.sh to be executed when running build.
You may need to insure that ./build.sh is executable which you can do with
before_install:
- chmod +x build.sh
You can also make the script bash build.sh or sh build.sh.

Related

How to view a file written from an error during a Github action?

I'm trying to install a module using CPAN but get this error:
Run cpanm --force DB_File
cpanm --force DB_File
shell: /usr/bin/bash -e {0}
env:
PERL5LIB: /home/runner/work/Bio-STR-exSTRa/Bio-STR-exSTRa/local/lib/perl5:/home/runner/work/_actions/shogo82148/actions-setup-perl/v1/scripts/lib
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz ... OK
Configuring DB_File-1.858 ... OK
! Installing DB_File failed. See /home/runner/.cpanm/work/1660633817.1777/build.log for details. Retry with --force to force install it.
Building and testing DB_File-1.858 ... FAIL
Error: Process completed with exit code 1.
How can I download or view the file /home/runner/.cpanm/work/1660633817.1777/build.log so I can diagnose the problem?
Github action YML file can be seen at https://github.com/bahlolab/Bio-STR-exSTRa/blob/master/.github/workflows/ci.yml.
You should take a look at GitHub artifacts:
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
You can use that method to expose files as a downloadable resources.

Set up CI with Travis for .NET Core

I'm trying to set up a CI for my .NET Core 3.1 class library. I created an account at https://travis-ci.org/github and selected my repository containing the code for my class library for a CI build.
Travis is successfully watching my master branch for commits, but I cannot get the CI build to succeed.
My repository: https://github.com/MintPlayer/MintPlayer.AspNetCore.SitemapXml
Target framework: .NET Core 3.1
My latest .travis.yml file:
language: csharp
mono: none
dotnet: 3.1.302
script:
- dotnet restore
dist: trusty
sudo: required
History of attempted travis.yml files (all failed):
But somehow this always errors, this time with the following output:
Clean output:
docker stop/waiting
resolvconf stop/waiting
C# support for Travis-CI is community maintained.
Please open any issues at https://travis-ci.community/c/languages/37-category and cc #joshua-anderson #akoeplinger #nterry
Installing .NET Core
$ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$ export DOTNET_CLI_TELEMETRY_OPTOUT=1
E: Unable to locate package dotnet-sdk-3.1
E: Couldn't find any package by glob 'dotnet-sdk-3.1'
E: Couldn't find any package by regex 'dotnet-sdk-3.1'
The command "sudo apt-get install -qq dotnet-sdk-3.1=3.1.302*" failed and exited with 100 during .
Your build has been stopped.
Raw output: https://api.travis-ci.org/v3/job/709293291/log.txt
What's wrong with my travis.yml configuration. Why can't I CI test my class library with this config?
I mainly want to CI test for .NET Core. If mono could be included this would be very nice. All the examples you'd find in the git history are also examples that I digged up in other repositories.
You are using:
dist: trusty
That's Ubuntu 14.04.6 LTS which is not supported by .NET Core 3.1. Try a newer version of Ubuntu such as bionic.
This is also answered in the travis community post:
dotnet-sdk-3.0 is not available for Trusty (presumably because it’s EOL): https://packages.microsoft.com/ubuntu/14.04/prod/dists/trusty/main/binary-amd64/Packages Move to dist: xenial (which is the default so you can just omit it) or dist: bionic.

TravisCI / Coverity: Warning - No files were emitted

I have a medium size github repository for which I configured Travis-CI/Coverity tools. About a month ago my setup had worked just fine: Travis compiled and built my application, and then performed the Coverity scan and I could see the results on my Coverity page.
However, lately, the Coverity analysis stopped working. I looked through the Travis log files and compared to the old logs when the builds were successful and that's what I found:
At the end of the log, the failed version contains the next warning:
[WARNING] No files were emitted. This may be due to a problem with your configuration or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
For more details, please look at: /home/travis/build/name/repo-name/build/cov-int/build-log.txt
Extracting SCM data for 0 files...
...
So, the Travis builds are passing, but nothing is generated for the Coverity. I checked my Travis config file and it is identical to the commits when the Coverity builds were successful.
For the sake of experiment, I cloned my project repository, rolled back to the version when the builds were successful and set up Travis/Coverity for them. And guess what? Same warning! So, the identical setup that worked in the past (about 35 days ago), does not work anymore. Therefore, I make conclusion, something had changed on the part of Travis since it does not generate certain files.
I was wondering if anyone encountered this issue? and what it could be about? Are there some Travis settings I need to change?
Some additional info: I use CMake to build my project, and it has two dependencies: Qt and OpenSceneGraph (which I have to install for Travis).
This is the approximate script of my .travis.yml on my coverity_scan branch:
language: cpp
os: linux
compiler: gcc
sudo: required
dist: trusty
addons:
apt:
packages:
- cmake
- g++-4.8
coverity_scan:
project:
name: "name/project"
description: "Build submitted via Travis CI"
notification_email: email#domain.com
build_command: "make -j2 VERBOSE=1"
branch_pattern: coverity_scan
env:
global:
- PROJECT_SOURCE=${TRAVIS_BUILD_DIR}/src/
- PROJECT_BUILD=${TRAVIS_BUILD_DIR}/build/
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "...secure..."
before_install:
# download Qt
# ...
# download OpenSceneGraph
# ...
# imitate x server
- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
- sleep 3
install:
# install Qt
- sudo apt-get --yes install qt55base qt55imageformats qt55svg
# compiler
- export CXX="g++-4.8"
- export CC="gcc-4.8"
# install OpenSceneGraph
# ...
before_script:
# Qt location
# ...
# OpenSceneGraph variables
# ...
# create build folder
- mkdir $PROJECT_BUILD
- cd $PROJECT_BUILD
# cmake command
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/qt54/lib/cmake -DProject_BUILD_TEST=ON -DProject_VERSION=0.0.0 $PROJECT_SOURCE
script:
- if [[ "${COVERITY_SCAN_BRANCH}" == 1 ]];
then
echo "Don't build on coverty_scan branch.";
exit 0;
fi
# compile everything, if not coverity branch
- make -j2
# run unit tests
# ...
After some research and looking through existing examples, I finally made it work. To fix the warning, and, therefore, to make sure files are emitted for the analysis, it is necessary to explicitly specify the compiler binary (updated according to the comment) . In my .travis.yml I had to add a build_command_prepend before the build_command of the coverity_scan add-on. An example of the final look for that block is as below:
# ...
coverity_scan:
project:
name: "name/project"
description: "Build submitted via Travis CI"
notification_email: name#domain.com
# ! have to specify the binary (updated, thanks to Caleb)
build_command_prepend: "cov-configure --comptype gcc --compiler gcc-4.8 --template"
build_command: "make VERBOSE=1"
branch_pattern: coverity_scan
# ...

Building spark-jobserver Using SBT and Scala

Can anyone suggest me a better documentation about spark-jobserver. I have gone through the url spark-jobserver but unable to follow the same. It will be great if some one explain step by step instruction on how to use spark-jobserver.
Tools used in building the project.
sbt launcher version 0.13.5
Scala code runner version 2.11.6
With the above mentioned tools I am getting errors while building the spark-jobserver.
The documentation provided in the jobserver repo is indeed confusing.
Here's the steps I followed to manually build and run Spark Job Server on a local machine.
1. git clone https://github.com/spark-jobserver/spark-jobserver
2. sudo mkdir -p /var/log/job-server
3. sudo chown user1:user1 /var/log/job-server
4. cd spark-jobserver
5. sbt job-server/assembly
6. cd config
7. cp local.sh.template abc.sh # Note that the same name 'abc' is used in steps 8 and 10 as well
8. cp ec2.conf.template abc.conf
9. cd .. # The jobserver root dir
10. ./bin/server_package.sh abc # This script copies the files and packages necessary to run job server into a single dir [ default - /tmp/job-server]
11. cd /tmp/job-server [This is where the files and packages necessary to run job server are published by default]
12. ./server_start.sh
13. Run ./server_stop.sh to stop the server
Hope this helps
Here are the steps that I used to install:
Clone the jobserver repo.
Get sbt using wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.8/sbt-0.13.8.tgz
Move "sbt-launch.jar" in sbt/bin to /bin
Create a script /bin/sbt, contents found here, making sure to change the pointer to java if necessary
Make the above script executable
Now cd into the spark jobserver directory, and run sbt publish-local
Assuming the above was successful, run sbt in the same directory
Finally, use the command re-start, and if it succeeds the server is now running!

Travis CI for Github?

I have a minimalistic .travis.yml file, which consists of:
php:
- "5.4"
But on console, it fails with:
$ rvm use default --install --binary --fuzzy
Using /home/travis/.rvm/gems/ruby-1.9.3-p448
$ ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
$ rvm --version
rvm 1.21.3 (latest-minor) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
$ gem --version
2.0.3
$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/travis/.rvm/gems/ruby-1.9.3-p448#global/bin/ruby_noexec_wrapper:14:in `eval'
/home/travis/.rvm/gems/ruby-1.9.3-p448#global/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
The command "rake" exited with 1.
Done. Your build exited with 1.
It's defaulting to ruby when I have specified PHP as the language, whats wrong here ?
Try making your .travis.yml a little less minimalist:
language: php
php:
- 5.4
Also, using php with travis uses phpenv instead of rvm
Read up more on it here:
http://about.travis-ci.org/docs/user/languages/php/
It took me some time to figure out so I'm posting here for anyone else that may encounter this in the future:
I had no idea that, in YAML, whitespace has meaning. Tabs/spaces (and possibly \r\n ("windows") vs \n ("linux")) matter. A simple change I did to my .yml file made a night-and-day difference (build failed before, built correctly after).
Lesson learned here: YAML cares about whitespace. Make sure your .travis.yml file is correct!