Pull Travis CI build detection logic to the top-level build.