From 7f4c6e871be3dc6b4f9f8df972fa64468336dc9a Mon Sep 17 00:00:00 2001 From: Anders Ha Date: Tue, 17 Oct 2017 10:38:49 +0800 Subject: [PATCH] CircleCI test run. --- Gemfile | 3 +++ circle.yml | 19 +++++++++++++++++++ script/test | 29 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 Gemfile create mode 100644 circle.yml create mode 100755 script/test diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..55b47b1 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'xcpretty' diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..47183d7 --- /dev/null +++ b/circle.yml @@ -0,0 +1,19 @@ +machine: + xcode: + version: "9.0" + +dependencies: + cache_directories: + - "Carthage/" + - "~/.cocoapods" + +test: + pre: + - carthage bootstrap --no-build + override: + - script/test iphonesimulator "platform=iOS Simulator,name=iPhone 6s" ReactiveFeedback + - script/test macosx "arch=x86_64" ReactiveFeedback + - script/test appletvsimulator "platform=tvOS Simulator,name=Apple TV" ReactiveFeedback + - script/test iphonesimulator "platform=iOS Simulator,name=iPhone 6s" Example build + - pod lib lint + - carthage build --no-skip-current --cache-builds diff --git a/script/test b/script/test new file mode 100755 index 0000000..9638888 --- /dev/null +++ b/script/test @@ -0,0 +1,29 @@ +#!/bin/bash + +if [[ "$1" == "macosx" ]]; then + XCODE_ACTION="build" +fi + +if [[ "$1" == "iphonesimulator" || "$1" == "appletvsimulator" ]]; then + XCODE_ACTION="build-for-testing test-without-building" +fi + +if [[ -n "$4" ]]; then + XCODE_ACTION="$4" +fi + +set -o pipefail +xcodebuild $XCODE_ACTION \ + -workspace ReactiveFeedback.xcworkspace \ + -scheme "$3" \ + -sdk "$1" \ + -destination "$2" \ + -configuration Release \ + ENABLE_TESTABILITY=YES \ + GCC_GENERATE_DEBUGGING_SYMBOLS=NO \ + RUN_CLANG_STATIC_ANALYZER=NO | bundle exec xcpretty +result=$? + +if [ "$result" -ne 0 ]; then + exit $result +fi