Skip to content

Instantly share code, notes, and snippets.

@calebkleveter
Created December 13, 2016 17:06
Show Gist options
  • Save calebkleveter/db4ef3b6746381e85f9b58e3b9adc6a2 to your computer and use it in GitHub Desktop.
Save calebkleveter/db4ef3b6746381e85f9b58e3b9adc6a2 to your computer and use it in GitHub Desktop.
Modified version of Vapor Travis test that excludes test cases.
#!/usr/bin/env bash
VERSION="3.0.1"
echo "Swift $VERSION 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-$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
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 "βœ… Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment