From b74e54b59998042e66b931fe8a844ab42ec347d0 Mon Sep 17 00:00:00 2001 From: noppoman Date: Tue, 27 Jun 2017 04:15:57 +0900 Subject: [PATCH] start ci --- .travis.yml | 14 ++++++++++++++ Scripts/install-swift.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .travis.yml create mode 100644 Scripts/install-swift.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..9fa20d6e7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +os: + - linux + - osx +language: generic +sudo: required +dist: trusty +osx_image: xcode8.3 + +install: + - source Scripts/install-swift.sh + +script: + - swift build + - swift test diff --git a/Scripts/install-swift.sh b/Scripts/install-swift.sh new file mode 100644 index 000000000..e6ce27601 --- /dev/null +++ b/Scripts/install-swift.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +VERSION="3.1" + +# Determine OS +UNAME=`uname`; +if [[ $UNAME == "Darwin" ]]; +then + OS="macos"; +else + if [[ $UNAME == "Linux" ]]; + then + UBUNTU_RELEASE=`lsb_release -a 2>/dev/null`; + if [[ $UBUNTU_RELEASE == *"15.10"* ]]; + then + OS="ubuntu1510"; + else + OS="ubuntu1404"; + fi + fi +fi + +if [[ $OS != "macos" ]]; +then + sudo apt-get install -y clang libicu-dev uuid-dev + + if [[ $OS == "ubuntu1510" ]]; + then + SWIFTFILE="swift-$VERSION-RELEASE-ubuntu15.10"; + else + SWIFTFILE="swift-$VERSION-RELEASE-ubuntu14.04"; + fi + wget https://swift.org/builds/swift-$VERSION-release/$OS/swift-$VERSION-RELEASE/$SWIFTFILE.tar.gz + tar -zxf $SWIFTFILE.tar.gz + export PATH=$PWD/$SWIFTFILE/usr/bin:"${PATH}" +fi