Add travis support

This commit is contained in:
Simon 2018-12-24 18:09:46 +08:00
parent 4f2d5d66fb
commit 53befa69b9
1 changed files with 37 additions and 0 deletions

37
.travis.yml Normal file
View File

@ -0,0 +1,37 @@
os: osx
osx_image: xcode10.1
language: swift
env:
global:
- LANG=en_US.UTF-8
- PROJECT="PlaceholderKit.xcodeproj"
- SCHEME="PlaceholderKit"
- IOS_SDK=iphonesimulator12.0
- OSX_SDK=macosx10.14
matrix:
- >-
DESTINATION="arch=x86_64" SDK="$OSX_SDK" SCHEME="$SCHEME"
RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- >-
DESTINATION="OS=12.0,name=iPhone 7" SDK="$IOS_SDK" SCHEME="$SCHEME"
RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES"
before_install:
- gem install --no-ri --no-rdoc cocoapods --pre # Required as CocoaPods is throwing errors on the example project
script:
- set -o pipefail
- 'if [ $POD_LINT == "YES" ]; then pod lib lint; fi'
# - >-
# if [ $BUILD_EXAMPLE == "YES" ]; then xcodebuild clean build -project
# Examples/TableViewExample/TableViewExample.xcodeproj -scheme
# TableViewExample -sdk "$SDK" -destination "$DESTINATION"; fi
- >-
if [ $RUN_TESTS == "YES" ]; then xcodebuild clean test -project
"$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION"
ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO; fi
- >-
if [ $RUN_TESTS != "YES" ]; then xcodebuild clean build -project
"$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION"
ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO ; fi
- swift test
after_success:
- 'bash <(curl -s https://codecov.io/bash)'