-
Notifications
You must be signed in to change notification settings - Fork 124
/
.travis.yml
68 lines (68 loc) · 3.3 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
branches:
only:
- master
language: objective-c
os: osx
cache:
- cocoapods
matrix:
include:
- osx_image: xcode9
env: TEST_TYPE=iOS SWIFT_VERSION=4.0 DESTINATION='platform=iOS Simulator,name=iPhone 4s,OS=8.1'
- osx_image: xcode10
env: TEST_TYPE=iOS SWIFT_VERSION=4.2 DESTINATION='platform=iOS Simulator,name=iPhone X,OS=11.1'
- osx_image: xcode11
env: TEST_TYPE=iOS SWIFT_VERSION=5.0 DESTINATION='platform=iOS Simulator,name=iPhone 11 Pro,OS=13.0'
- osx_image: xcode11
env: TEST_TYPE=macOS SWIFT_VERSION=5.0
- osx_image: xcode11
env: TEST_TYPE=tvOS SWIFT_VERSION=5.0
- osx_image: xcode11
env: TEST_TYPE=SwiftPM
- osx_image: xcode11
env: TEST_TYPE=Lint
- osx_image: xcode11
env: TEST_TYPE=Distribution
before_install:
- |
if [ "$TEST_TYPE" = Lint ] || [ "$TEST_TYPE" = Distribution ]; then
brew update
fi
install:
- |
if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = macOS ] || [ "$TEST_TYPE" = tvOS ]; then
gem install xcpretty --no-document
elif [ "$TEST_TYPE" = Lint ]; then
brew install swiftlint || brew upgrade swiftlint
elif [ "$TEST_TYPE" = Distribution ]; then
gem install cocoapods --pre --quiet --no-document
brew install carthage || brew upgrade carthage
fi
script:
- |
[ ! -z "$SWIFT_VERSION" ] && sed -i '' -e "s/^SWIFT_VERSION *=.*/SWIFT_VERSION = $SWIFT_VERSION/g" Configurations/*.xcconfig
if [ "$TEST_TYPE" = iOS ]; then
set -o pipefail
xcodebuild test -project BoltsSwift.xcodeproj -sdk iphonesimulator -scheme BoltsSwift-iOS -configuration Debug -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
xcodebuild test -project BoltsSwift.xcodeproj -sdk iphonesimulator -scheme BoltsSwift-iOS -configuration Release -destination "$DESTINATION" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
elif [ "$TEST_TYPE" = macOS ]; then
set -o pipefail
xcodebuild test -project BoltsSwift.xcodeproj -sdk macosx -scheme BoltsSwift-macOS -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
xcodebuild test -project BoltsSwift.xcodeproj -sdk macosx -scheme BoltsSwift-macOS -configuration Release GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
elif [ "$TEST_TYPE" = tvOS ]; then
set -o pipefail
xcodebuild test -project BoltsSwift.xcodeproj -sdk appletvsimulator -scheme BoltsSwift-tvOS -destination "platform=tvOS Simulator,name=Apple TV" -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
xcodebuild test -project BoltsSwift.xcodeproj -sdk appletvsimulator -scheme BoltsSwift-tvOS -destination "platform=tvOS Simulator,name=Apple TV" -configuration Release GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty -c
elif [ "$TEST_TYPE" = SwiftPM ]; then
swift test -v
elif [ "$TEST_TYPE" = Lint ]; then
swiftlint lint
elif [ "$TEST_TYPE" = Distribution ]; then
pod lib lint Bolts-Swift.podspec
carthage build --no-skip-current
fi
after_success:
- |
if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = macOS ] || [ "$TEST_TYPE" = tvOS ]; then
bash <(curl -s https://codecov.io/bash)
fi