Since I was having such a hard time getting this working, I figure I’ll put this up here for everyone else too.
I have a project that I want to build for both Linux and OS X using Swift on travis-ci.org.
First you’ll need a proper .travis.yml file:
This is what is working for me. The super important part is the dist: trusty and sudo: required. Without those for the linux build, you won’t get Ubuntu 14.04 and thus won’t be able to run the Swift compiler.
The InstallSwift.sh script looks like this:
It’s not a perfect setup, but it was enough to get me up and running. Hopefully it’s helpful to others in the same boat as me.