Skip to content

Commit

Permalink
Configure Travis CI to run SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Pilcher committed Jun 8, 2016
1 parent feeccfb commit 2d4d59f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
language: objective-c
osx_image: xcode7.3

install:

- ./install_swiftlint.sh

script:

- swiftlint

- xcodebuild test -project ./All-Pairs\ Shortest\ Paths/APSP/APSP.xcodeproj -scheme APSPTests
- xcodebuild test -project ./Array2D/Tests/Tests.xcodeproj -scheme Tests
- xcodebuild test -project ./AVL\ Tree/Tests/Tests.xcodeproj -scheme Tests
Expand Down
23 changes: 23 additions & 0 deletions install_swiftlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Installs the SwiftLint package.
# Tries to get the precompiled .pkg file from Github, but if that
# fails just recompiles from source.

set -e

SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.10.0/SwiftLint.pkg"

wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL

if [ -f $SWIFTLINT_PKG_PATH ]; then
echo "SwiftLint package exists! Installing it..."
sudo installer -pkg $SWIFTLINT_PKG_PATH -target /
else
echo "SwiftLint package doesn't exist. Compiling from source..." &&
git clone https://github.com/realm/SwiftLint.git /tmp/SwiftLint &&
cd /tmp/SwiftLint &&
git submodule update --init --recursive &&
sudo make install
fi

0 comments on commit 2d4d59f

Please sign in to comment.