forked from kaltura/playkit-ios-dtg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-build.sh
executable file
·43 lines (35 loc) · 920 Bytes
/
travis-build.sh
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
#!/bin/bash
set -eou pipefail
# Travis aborts the build if it doesn't get output for 10 minutes.
keepAlive() {
while [ -f $1 ]
do
sleep 10
echo .
done
}
testApp() {
touch /tmp/DontPlay
echo Building the test app
cd Example
pod install
CODE=0
xcodebuild test -workspace DownloadToGo.xcworkspace -scheme DownloadToGo-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone X' | tee xcodebuild.log | xcpretty -r html || CODE=$?
export CODE
env > env.txt
zip --junk-paths data.zip xcodebuild.log build/reports/tests.html env.txt
curl "$ARTIFACT_UPLOAD_URL" [email protected] -FResult=$CODE
[ $CODE == 0 ]
}
libLint() {
echo Linting the pod
pod lib lint --allow-warnings
}
FLAG=$(mktemp)
if [ -n "$TRAVIS_TAG" ] || [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then
keepAlive $FLAG &
libLint
else
testApp
fi
rm $FLAG # stop keepAlive