Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
update travis and version for 3.0 release (#50)
Browse files Browse the repository at this point in the history
[CI] Update build scripts and use swift 3.0 Release.
  • Loading branch information
loganwright authored and endocrimes committed Sep 14, 2016
1 parent 4bb31b2 commit 1c381d7
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 11 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@

os:
- linux
- osx
language: generic
sudo: required
dist: trusty
osx_image: xcode8
install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"
script:
- swift build
- swift build -c release
- swift test
notifications:
email:
on_success: never
on_failure: change

- bash ./.travis/ci
- bash ./.travis/codecov
70 changes: 70 additions & 0 deletions .travis/ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash

echo "Swift 3 Continuous Integration";

# 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
else
echo "Unsupported Operating System: $UNAME";
fi
fi
echo "🖥 Operating System: $OS";

if [[ $OS != "macos" ]];
then
echo "📚 Installing Dependencies"
sudo apt-get install -y clang libicu-dev uuid-dev

echo "🐦 Installing Swift";
if [[ $OS == "ubuntu1510" ]];
then
SWIFTFILE="swift-3.0-RELEASE-ubuntu15.10";
else
SWIFTFILE="swift-3.0-RELEASE-ubuntu14.04";
fi
wget https://swift.org/builds/swift-3.0-release/$OS/swift-3.0-RELEASE/$SWIFTFILE.tar.gz
tar -zxf $SWIFTFILE.tar.gz
export PATH=$PWD/$SWIFTFILE/usr/bin:"${PATH}"
fi

echo "📅 Version: `swift --version`";

echo "🚀 Building";
swift build
if [[ $? != 0 ]];
then
echo "❌ Build failed";
exit 1;
fi

echo "💼 Building Release";
swift build -c release
if [[ $? != 0 ]];
then
echo "❌ Build for release failed";
exit 1;
fi

echo "🔎 Testing";

swift test
if [[ $? != 0 ]];
then
echo "❌ Tests failed";
exit 1;
fi

echo "✅ Done"
28 changes: 28 additions & 0 deletions .travis/codecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

echo "Swift 3 CodeCov Integration";

# Determine OS
UNAME=`uname`;
if [[ $UNAME == "Darwin" ]];
then
OS="macos";
else
echo "🚫 Unsupported OS: $UNAME, skipping...";
exit 0;
fi
echo "🖥 Operating System: $OS";


PROJ_OUTPUT=`swift package generate-xcodeproj`;
PROJ_NAME="${PROJ_OUTPUT/generated: .\//}"
SCHEME_NAME="${PROJ_NAME/.xcodeproj/}"

echo "🚀 Testing: $SCHEME_NAME";

rvm install 2.2.3
gem install xcpretty
WORKING_DIRECTORY=$(PWD) xcodebuild -project $PROJ_NAME -scheme $SCHEME_NAME -sdk macosx10.12 -destination arch=x86_64 -configuration Debug -enableCodeCoverage YES test | xcpretty
bash <(curl -s https://codecov.io/bash)

echo "✅ Done";

0 comments on commit 1c381d7

Please sign in to comment.