Travis support for PRs and master, stable5 and stable6

Continuation of #8913
Didn't know about if it needs further tweaking at scrutinizer.