Skip to content

Commit

Permalink
Merge pull request #11 from skyweb07/feature/integrate-tracis-ci
Browse files Browse the repository at this point in the history
Add travis CI integration
  • Loading branch information
skyweb07 authored Nov 29, 2017
2 parents 92c59cd + c5e4fbd commit f1281e2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .scripts/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.24.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
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: objective-c
osx_image: xcode9.1

sudo: required
install:
- ./.scripts/install-swiftlint.sh

script:
- swiftlint
- xcodebuild -scheme Snap -project ./Snap.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 7' test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</p>
<h1 align="center">Snap.swift - Snapshot testing in a snap 🎨</h1>
<p align="center">
<img src="https://travis-ci.org/skyweb07/Snap.swift.svg?branch=feature%2Fintegrate-tracis-ci"/>
<img src="https://img.shields.io/badge/Swift-4.0-orange.svg" />
<a href="https://twitter.com/skyweb07">
<img src="https://img.shields.io/badge/[email protected]?style=flat" alt="Twitter: @skyweb07" />
Expand Down

0 comments on commit f1281e2

Please sign in to comment.