Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to handle building and testing #3

Merged
merged 3 commits into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: objective-c
osx_image: xcode8.3
xcode_project: Hanson.xcodeproj
xcode_scheme: Hanson
xcode_sdk: iphonesimulator10.3

script:
- xcodebuild clean test -sdk iphonesimulator -project Hanson.xcodeproj -scheme Hanson -destination 'platform=iOS Simulator,name=iPhone 7' CODE_SIGNING_REQUIRED=NO
- ./script/cisetup
- ./script/citest
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'xcpretty'
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
rouge (2.0.7)
xcpretty (0.2.8)
rouge (~> 2.0.7)

PLATFORMS
ruby

DEPENDENCIES
xcpretty

BUNDLED WITH
1.13.6
7 changes: 7 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -aeu

cd "$(dirname "$0")/.."

# Install Ruby dependencies
bundle install
10 changes: 10 additions & 0 deletions script/cisetup
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -aeu

cd "$(dirname "$0")/.."

# Load config
source ./script/etc/config.sh

# Install dependencies
./script/bootstrap
16 changes: 16 additions & 0 deletions script/citest
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -aeu

cd "$(dirname "$0")/.."

# Load config
source ./script/etc/config.sh

# Run tests
xcodebuild clean test \
-sdk $SDK \
-project $PROJECT \
-scheme $SCHEME \
-destination "platform=${PLATFORM},name=${DEVICE}" \
CODE_SIGNING_REQUIRED=NO \
| bundle exec xcpretty -c
5 changes: 5 additions & 0 deletions script/etc/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SDK=iphonesimulator
PROJECT=Hanson.xcodeproj
SCHEME=Hanson
PLATFORM="iOS Simulator"
DEVICE="iPhone 7"
10 changes: 10 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -aeu

cd "$(dirname "$0")/.."

# Load config
source ./script/etc/config.sh

# Install dependencies
./script/bootstrap
15 changes: 15 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -aeu

cd "$(dirname "$0")/.."

# Load config
source ./script/etc/config.sh

# Run tests
xcodebuild clean test \
-sdk $SDK \
-project $PROJECT \
-scheme $SCHEME \
-destination "platform=${PLATFORM},name=${DEVICE}" \
| bundle exec xcpretty -c && exit ${PIPESTATUS[0]}