Search code examples
androidgradleandroid-gradle-plugintravis-ci

How to display HTML-formatted output files in Travis?


I'm trying to deploy an Android library on Bintray using Travis-CI. But when I upload my repo... I got this:

Ran lint on variant release: 6 issues found

Ran lint on variant debug: 6 issues found

Wrote HTML report to file:///home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.html

Wrote XML report to file:///home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.xml

:app:lint FAILED

Normally I would go to my project out put and read the lint-results-debug.html... But I don't know how to access this file in Travis.

So, How can I access outputs/lint-results-debug.html in Travis??

Any help is welcome!

Edit

my .travis.yml:

language: android
jdk: oraclejdk8
sudo: false

addons:
  apt:
    packages:
      - lynx

android:
  components:
  - platform-tools
  - tools
  - build-tools-25.0.0
  - android-25
  - extra-android-m2repository
script: 
  - if [ -f /home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.html ]; then lynx -dump /home/travis/build/leandroBorgesFerreira/MoreCLoseButton/app/build/outputs/lint-results-debug.html; fi
  - ./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" build
  bintrayUpload --stacktrace --info
env:
  global:
  - secure: [...]
  - secure: [...]

Solution

  • 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