How to display HTML-formatted output files in Travis?

You can use lynx -dump to dump a plain-text rendering of any HTML file output from a Travis run.

To make Travis install lynx -dump: To the top of your .travis.yml, add this:

addons:
  apt:
    packages:
      - lynx

Assuming the HTML file is an error log of some kind, you can make Travis show the output by putting something like the following in the script part of your .travis.yml:

after_failure:
  - if [ -f /home/travis/build/…/foo.html ]; then lynx -dump /home/travis/build/…/foo.html; fi

While sideshowbarker gave a generic answer, I'd like to point out that Android lint has an option for console output, so you can do this in your build.gradle:

android {
    lintOptions {
        textReport = true
        //textOutput "stdout" // default location, perfect for travis
    }
}

Which removes the need for an extra dependency, and an extra script; plus it's reproducible on local machine easily.

One can take this a step further (in case spamming console on local machine is to be avoided) and do

android {
    lintOptions {
        textReport = project.property("lint.output.console").toBoolean()
    }
}

and in gradle.properties: lint.output.console=false

and in .travis.yml: gradlew -Plint.output.console=true build