Any Travis experts? Trying to improve library PRs


I think it might help to speed up review of PRs to the offical libs if there was a graphical preview of the PRs.

I’ve modified cpavlina’s script [1] which generates image for components, so that it could be used to generate images of changed components (added or modified) in the Travis check.

I think I can see how to adapt [2] to call the schlib-render script, and output a png.

The question is, is there a server accessible to Travis which could be used to store the images? Then we automatically add the image to pull requests.

The OpenSCAD project does a similar thing, they even compare the images to verify code changes have not broken anything and produce an HTML report. Example [3]



It appears OpenSCAD upload to one of their servers - “” (see, via a secure mechanism (I guess no one wants files being transferred just anywhere, would be a gift for hackers).

I can’t see where the openscad test scripts do an upload, it’s buried somewhere.

Travis also support Amazon S3 (cloud service), it appears you have to pay for that (after free trial expires).

Here is a sample file from


Great idea!

Is there any way to upload the image to GitHub somehow? For example when you embed an image into a comment it auto-uploads.

Perhaps Travis could make a comment on the PR page itself, and upload the image there?


This might be worth looking into -


One possible solution that does not require configuring a server, is to upload the images to a free service like imgur (unlimited API uploads for open-source projects) using credential stored in a “Travis secret”, see

The main problem with this solution is that these secrets are not accessible during Travis builds that are caused by pull requests generated from forks. Only pull requests from the same repository (but from a non-master branch, naturally) can use these secrets. (See

If testing only post-merge commits or pull requests from the main fork is OK, then that Travis secrets + imgur is a viable option.

@SchrodingersGat: Unfortunately the GitHub API does not allow you to upload images. GitHub internally receives the images, uploads them on the fly and then the brower-side interface inserts a link into the message.


Total out of the box here, but why go for an image if you can use the code of the internet itself to create the image on the fly - not just for the PRs?
There should be a couple of javascript or php libs out there, which are capable of this, no?



Interesting idea, not sure how to tie that in with Travis.

Currently Travis CI adds a link to PRs, which looks like

The Travis script is limited to text output, I think.


I found where OpenSCAD do their upload in

They use scp (secure copy with SSH). The process is

  1. run the tests
  2. Create an HTML report local to Travis
  3. Copy the report file to
  4. Print the link e.g.

This doesn’t update the PR, but at least the report is available. The link could be pasted manually until we find a better way. I wonder if we could use to host report files?


I think I found a server to upload files to

So the plan is

  1. Modify to output a list of changed components
  2. Modify to call new script with library name
  3. creates an html file containing a report (with embedded images)
  4. The report file is uploaded via sftp to (for now)
  5. somehow the link is posted in the PR that kicked off the Travis build (not sure about that step)

I think I have done most of the first 3 steps, I’ll need to experiment with 4.