Thursday, November 5, 2015

Experimenting with Travis

Travis makes simple things simple, but it can be somewhat fiddly when things get more complicated. This normally means that setting up builds that have external dependencies, or which involve additional tools, involves a fair amount of trial and error. To help with this:

  • Set up your build in a temporary branch in your repo, and only copy the changes across into your main branch when the build is fully working. Anyone who syncs to a branch called temp deserves to have that branch deleted out from under them, and confining build changes to a branch like that means the main branch doesn't get polluted by the inevitable sequence of "debug", "tweak config" , "add missing CFLAGS option" commits.
  • Test out each change to the build locally before pushing to GitHub and Travis. Given the time taken for a Travis build cycle (particularly once the Americans wake up), it's normally worth checking the build locally to catch typos and misconfigurations faster.
  • When setting up the build of an Autotools based project, include a script: line like ./configure $CONFIG_OPTS || tail -1000 config.log, so that you can find out more than a single bit of information when the configure step fails.

No comments:

Post a Comment