Travis build script for swift package manager based packages


Travis CI has OSX images and can build swift code but that’ll be <= swift 2.1 and will not be able to use swift package manager to build the packages yet. This .travis.yml will fetch the open source swift snapshot, install it on ubuntu (14.04) image on travis (called trusty) and run swift build.

sudo: required
dist: trusty
before_install:
  - wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
  - wget https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-22-a/swift-2.2-SNAPSHOT-2015-12-22-a-ubuntu14.04.tar.gz
  - tar xzf swift-2.2-SNAPSHOT-2015-12-22-a-ubuntu14.04.tar.gz
  - export PATH=${PWD}/swift-2.2-SNAPSHOT-2015-12-22-a-ubuntu14.04/usr/bin:"${PATH}"
script:
  - swift build

go get your build passing badge for your pure swift package :D

build passing

Github Example : https://github.com/aciidb0mb3r/TravisSPM