branches:
  except: 
    - rpi

language: generic
sudo: required

matrix:
  include:
    - os: linux
      dist: trusty
      env:
        - SWIFT_VERSION=swift-3.1
          SWIFT_BUILD=$SWIFT_VERSION-RELEASE-ubuntu14.04
          SWIFT_URL=https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1404/$SWIFT_VERSION-RELEASE/$SWIFT_BUILD.tar.gz
          PATH="$SWIFT_BUILD/usr/bin:$PATH"
    - os: osx
      osx_image: xcode8.3
      env:
        - OPENSSL_ROOT_DIR=$(brew --prefix openssl)

install:
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
      echo "Installing Swift...";
      curl "$SWIFT_URL" | tar -xzf - || exit 2;
    fi;

    echo "Installing libwebsockets...";
    git clone "https://github.com/warmcat/libwebsockets" || exit 3;
    pushd libwebsockets || exit 5;
    (cmake . && make && sudo make install) || exit 5;
    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ldconfig; fi;
    popd

script:
  - ./test.sh

branches:
  except: 
    - rpi

language: generic
sudo: required
env: SWIFT_VERSION=3.1

matrix:
  include:
    - os: linux
      dist: trusty
    - os: osx
      osx_image: xcode8.3
      env:
        - OPENSSL_ROOT_DIR=$(brew --prefix openssl)

install:
  - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"

  - git clone "https://github.com/warmcat/libwebsockets" || exit 3;
    pushd libwebsockets || exit 5;
    (cmake . && make && sudo make install) || exit 5;
    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ldconfig; fi;
    popd

script:
  - ./test.sh

Use swiftenv to install Swift for CI
Use swiftenv to install Swift for CI