<< Adding a blog aggregator Back to index... Comparing some physics engine APIs >>

Minor Gripe

2019-05-30 -- Misadventures in CI

Chris Ertel

Yesterday I spent many, many hours fighting with getting projects setup with CI.

For the Elixir physics engine I’m breaking ground on, I need to setup my usual library infrastructure.

For me, I consider the “bare minimum” for developing a library for other people to be:

  1. Master should pass tests at all times
  2. 100% test coverage
  3. 100% docs coverage of all APIs
  4. Proper SemVer
  5. Minimum external dependencies if at all possible–easier with mathy stuff

The first three are what cost me hours of my life yesterday.

For 1, getting any CI setup is reasonable. Until yesterday, I used TravisCI and CircleCI both, with the idea that more builds are better–this was confirmed by a rounding issue that turns up over in graphmath. CircleCI was used by itself, TravisCI was wired up to phone home to other services that provided 2 and 3.

For 2, I use coveralls.io via the excoveralls library. This generally works, but the ability of the library to run with either Travis or CircleCI seems to be compromised. In particular, when used as part of a script, the suggested mix coveralls.travis or similar tasks just don’t run–regardless of environment. A quick scan of the mix source suggests that they should be there, but they aren’t, so that was frustrating. There is, however, a generic mix coveralls.post command that can be used to “manually” ship results back to coveralls.

Using that method, I was able to ship info to the mothership. However, it was missing key things like the branch of the commit, the hash, etc. These params can be passed in as command-line options, but I then ran into issues interpolating results from git into it. Turns out that a lot of those can exist (theoretically) as environment variables in the various CI system. So, Circle’s docs suggest a solution first (plus grumpy blog posts and issues on Github about Travis), so I switched that build script to doing the needful. This worked, and I deprecated Travis across all the projects I was using it on.

For 3, I used Inch-CI as a place to accumulate documentation coverage reported by inch_ex. I say used becauswe the site doesn’t appear to be accepting data anymore. It’s a generous free project by rrrene, so I can’t complain too much about it not working, but it is a bummer. I thought about hosting it myself but that is a bit far afield of the problem I really wanted to solve.

All of this done, I threw in the towel and have readjusted my hopes and dreams to no longer include easy documentation coverage and badges for future projects. :(

Tags: kvetch

<< Adding a blog aggregator Back to index... Comparing some physics engine APIs >>