roboticslab-uc3m / developer-manual

Developer Manual @ roboticslab-uc3m
https://robots.uc3m.es/developer-manual/
1 stars 1 forks source link

Advise of proper placement of build steps in Travis YAML files #21

Closed PeterBowman closed 3 years ago

PeterBowman commented 6 years ago

From roboticslab-uc3m/kinematics-dynamics@677eeab:

A build failure in 'before_script' marks the whole job as 'errored' and prevents from entering the following sections. On the other hand, errors within 'script' mark the job as 'failed', but will not cancel it right away. The point of this commit is to provide a means of distinguishing build/test failures and to abort the execution of test scripts if there are no binaries to link to.

diff --git a/.travis.yml b/.travis.yml
index 0d337c64..fcb3a142 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,12 +49,12 @@ install:

 before_script:
   - mkdir -p build && cd build
-
-script:
   - cmake .. -DENABLE_coverage=ON
   - make
   - sudo make install
   - sudo ldconfig
+
+script:
   - bin/testKdlSolver
   - bin/testKdlSolverFromFile
   - bin/testBasicCartesianControl

Reference: https://docs.travis-ci.com/user/customizing-the-build/#Breaking-the-Build.

PeterBowman commented 6 years ago

Using set -e in sourced shell scripts may lead to build failures even if placed in a "safe" section, e.g. after_success: https://github.com/roboticslab-uc3m/tools/commit/2f0fddb96202a20feadc9546e8916e86de9dea34.

PeterBowman commented 6 years ago

Note: https://github.com/roboticslab-uc3m/questions-and-answers/issues/48 ended in adopting a new template for YAML files (sample).

davidvelascogarcia commented 5 years ago

I´m not sure if this issue is the best place to comment the problem that i had with Travis CI using a docker container with Ubuntu 18.04 image but i can´t find another similar issue. I´m trying to add CI to tensorflow_cc projects using docker images with tensorflow_cc pre-build, because tensorflow_cc build requires a lot of time and at the end gets Travis timeout error. Tensorflow_cc docker image use Ubuntu 18.04. Doing tests, i tried to install opencv with sudo apt-get install libopencv-dev but the job stop in geographic area selection, job attached. Maybe there is some command to solve it. P.D: The same problem installing yarp from binaries.

PeterBowman commented 5 years ago

Please try DEBIAN_FRONTEND=noninteractive apt-get install -y libopencv-dev (SO).

davidvelascogarcia commented 5 years ago

@PeterBowman Thanks, works!

PeterBowman commented 3 years ago

Marked as WONTFIX, we are migrating now to GitHub Actions: https://github.com/roboticslab-uc3m/questions-and-answers/issues/91.