From b8de8d36b63b513317db736df3c06f539398ceeb Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 15 Nov 2018 13:19:13 -0500 Subject: Add travis config to build/test. --- .travis.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 13 +++++++++++++ 2 files changed, 70 insertions(+) create mode 100755 .travis.sh create mode 100644 .travis.yml diff --git a/.travis.sh b/.travis.sh new file mode 100755 index 0000000..4aa9c33 --- /dev/null +++ b/.travis.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +set -eu + +if [[ "$#" -ne 2 ]]; then + echo "Usage: $0 {iOS|OSX} {Debug|Release|Both}" + exit 10 +fi + +BUILD_MODE="$1" +BUILD_CFG="$2" + +# Report then run the build +RunXcodeBuild() { + echo xcodebuild "$@" + xcodebuild "$@" +} + +CMD_BUILDER=( +) +XCODE_ACTIONS=( + build test +) + +case "${BUILD_MODE}" in + iOS) + CMD_BUILDER+=( + -project GTMiPhone.xcodeproj + -scheme "GTMiPhone" + -destination "platform=iOS Simulator,name=iPhone 6,OS=latest" + ) + ;; + OSX) + CMD_BUILDER+=( + -project GTM.xcodeproj + -scheme "GTM" + ) + ;; + *) + echo "Unknown BUILD_MODE: ${BUILD_MODE}" + exit 11 + ;; +esac + +case "${BUILD_CFG}" in + Debug|Release) + RunXcodeBuild "${CMD_BUILDER[@]}" -configuration "${BUILD_CFG}" "${XCODE_ACTIONS[@]}" + ;; + Both) + RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Debug "${XCODE_ACTIONS[@]}" + RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Release "${XCODE_ACTIONS[@]}" + ;; + *) + echo "Unknown BUILD_CFG: ${BUILD_CFG}" + exit 12 + ;; +esac diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dd627b0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: objective-c +osx_image: xcode9.4 +env: + - MODE=OSX CFG=Debug + - MODE=OSX CFG=Release + - MODE=iOS CFG=Debug + # iOS Release is currently failing with linker errors before even running + # the tests. + #- MODE=iOS CFG=Release +script: + - ./.travis.sh "${MODE}" "${CFG}" +notifications: + email: false -- cgit v1.2.3