When checking the docs you soon find out that each of the supported languages is described in isolation. Indeed, when it comes to the build configuration, one of the very first steps is an explicit choice of a single language:
language: java
The project I was looking to integrate with Travis CI was a hybrid powered by gradle and gulp and comprising Java, Scala and JavaScript. How could I possibly overcome that single-language limitation? Surprisingly enough, a request for multiple simultaneous languages has been around for a long time. I couldn't understand why it was never added. Luckily, this conversation on github pointed me to the right direction. Turns out the only thing to worry about are project dependencies (obvious, huh?). It didn't take long before I was thrilled to see my first successful build.
After only a few failed build attempts I had the final version of my build script ready:
language: java
before_install:
- npm install gulp gulp-mocha gulp-util chai
- sudo apt-get update
- sudo apt-get install scala
script: "gradle build"
As you can see I simply made sure all of the dependencies were fetched ahead of the actual build.
The actual build output - it's easy to see how closely it matches the config
It might take a while for all the downloads to complete, but the overall build time was still impressive.
The project (a demo of basic algorithms and data structures) is available on github. And so is a link to the build page.
You might be interested in getting an updated nodejs version along with another language on Travis CI without using sudo: http://entulho.fiatjaf.alhur.es/guias/how-to-use-node-along-with-other-language-on-travis-ci/
ReplyDelete