This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
128 lines (109 loc) · 4.04 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
language: objective-c
os: osx
osx_image: xcode8.2
cache:
cocoapods: true
directories:
- Carthage
xcode_project: MoyaUnbox.xcodeproj
xcode_scheme:
- MoyaUnbox
- RxMoyaUnbox
- ReactiveMoyaUnbox
env:
- CACHE_NAME=iOS PLATFORM=iOS
- CACHE_NAME=macOS PLATFORM=macOS
- CACHE_NAME=tvOS PLATFORM=tvOS
- CACHE_NAME=watchOS PLATFORM=watchOS
matrix:
allow_failures:
- xcode_project: MoyaUnbox.xcodeproj
xcode_scheme: MoyaUnbox
env: CACHE_NAME=watchOS PLATFORM=watchOS
- xcode_project: MoyaUnbox.xcodeproj
xcode_scheme: RxMoyaUnbox
env: CACHE_NAME=watchOS PLATFORM=watchOS
- xcode_project: MoyaUnbox.xcodeproj
xcode_scheme: ReactiveMoyaUnbox
env: CACHE_NAME=watchOS PLATFORM=watchOS
before_install:
- brew update
# Cocoapod
- brew outdated cocoapods || brew upgrade cocoapods
# SwiftLint
- brew outdated swiftlint || brew upgrade swiftlint
# Carthage tools
- brew outdated carthage || brew upgrade carthage
- curl -L -O https://github.com/YPlan/CartfileDiff/releases/download/0.1/CartfileDiff.pkg
- sudo installer -pkg CartfileDiff.pkg -target /
# xcpretty
- gem install xcpretty
# danger
- gem install danger danger-swiftlint
before_script:
- export RUN_TESTS="YES"
- export POD_LINT="NO"
- export SCHEME="${TRAVIS_XCODE_SCHEME}-${PLATFORM}"
- case "${PLATFORM}" in
"iOS")
export SDK="iphonesimulator10.2";
export DESTINATION="platform=iOS Simulator,OS=10.1,name=iPhone 7";
;;
"macOS")
export SDK="macosx10.12";
export DESTINATION="platform=OS X,arch=x86_64";
;;
"tvOS")
export SDK="appletvsimulator10.1";
export DESTINATION="OS=10.0,name=Apple TV 1080p";
;;
"watchOS")
export SDK="watchsimulator3.1";
export DESTINATION="platform=watchOS Simulator,OS=3.1,name=Apple Watch Series 2 - 42mm";
export RUN_TESTS="NO";
;;
esac
- if [ ${SCHEME} == "MoyaUnbox-iOS" ]; then
export POD_LINT="YES";
fi
# bootstrap the dependencies for the project
# you can remove if you don't have dependencies
- PLATFORM=${PLATFORM} ./scripts/bootstrap-if-needed
script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks
- xcodebuild clean -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" | xcpretty
# Build Framework in Debug and Run Tests if specified
- echo "BUILD FOR DEBUG"
- if [ ${RUN_TESTS} == "YES" ]; then
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi
- xcodebuild clean -project "$TRAVIS_XCODE_PROJECT" -scheme "$SCHEME" | xcpretty
# Build Framework in Release and Run Tests if specified
- echo "BUILD FOR RELEASE"
- if [ ${RUN_TESTS} == "YES" ]; then
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
else
xcodebuild -project "${TRAVIS_XCODE_PROJECT}" -scheme "${SCHEME}" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
fi
# Build Example in Debug if specified
- if [ ${SDK} == "iOS" ]; then
cd Demo;
pod install;
xcodebuild -project "Demo.xcworkspace" -scheme "Demo" -sdk "${SDK}" -destination "${DESTINATION}" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
cd ..;
fi
# Run `pod lib lint` if specified
- if [ $POD_LINT == "YES" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
pod repo update > /dev/null;
travis_wait 60 pod lib lint --allow-warnings;
fi
after_success:
- danger
- bash <(curl -s https://codecov.io/bash)
#before_deploy:
# - carthage build --no-skip-current
# - carthage archive $FRAMEWORK_NAME