Optimize your Travis Builds

TCI-Graphics for AdsBlogs (4)

In general, CI greatly reduces the amount of time an engineer needs to spend finding the origin of a bug by running tests early and often, this in conjunction with unit tests. With things in the Travis CI arsenal like Arm, IBM Z and you integrate those into a central repository where the tests can be run, you can almost be assured a blazing fast productive work environment.

Some Things to Remember

There’s many important metrics in software development, but one of the most important metric is increasing development speed, the way you do that is, decreasing build time.


I’ve long been a fan of using bash in my .travis.yml configurations, not only does this setup somewhat of a templating system, but it can further automate things, in turn speeding up build times.


With the flexibility Travis offers, you can sometimes even cache arbitrary directories where you might write your own dependencies. Avoid over-caching though, this sometimes can do more harm than good in a build.

The Syntax

Just remember, you don’t need to use $?, Travis internally handles this.

Skip Unncessary Builds

If you’re on a pull request and lets say you push code that was incorrect and then immediately push a fix. That first build is still going to run but should be canceled as quickly as possible, this will cause a queue, in other words, a backup of builds, so you can always add for some builds ci:skip.

Build Matrix

Now depending on the size and complexity of your test suite, you can split it up even further. You could separate different concerns for integration tests into different subfolders and run them in separate stages of a build matrix, in turn really clearing things up for you or a developer if changes need to be made.

The Right Architecture

Depending on what you’re building checkout the brand new version of arm64 we are using, and how blazing fast it is, for other builds look at IBM Z and the s390x architecture, these both are blazing fast and will help get your build speeds to a whole new level. Checkout my blog post about the new Arm architecture.

Happy building!

As always if you have any questions, just email me at montana@travis-ci.org.