forked from bustoutsolutions/siesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
88 lines (64 loc) · 2.84 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
branches:
only:
- master
language: objective-c
os: osx
osx_image: xcode8.1
env:
- scheme='Siesta macOS' platform='OS X'
- scheme='Siesta iOS' platform='iOS Simulator' ios_version='10.1' ios_device='iPhone SE'
- scheme='Siesta iOS' platform='iOS Simulator' ios_version='9.3' ios_device='iPhone 6'
- scheme='Siesta iOS' platform='iOS Simulator' ios_version='8.1' ios_device='iPhone 4s'
before_install: |
ios_simulator_udid=$(instruments -s devices | grep "$ios_device ($ios_version)" | sed -E 's/.*\[([0-9A-F-]+)\].*/\1/g')
echo "Prelaunching iOS simulator with UDID $ios_simulator_udid"
open -a "simulator" --args -CurrentDeviceUDID $ios_simulator_udid
script: |
# ------ Certificates ------
# Thanks to https://github.com/Carthage/Carthage/blob/12fb7881876b4987584e49d00befcd2a8b6b354d/script/cibuild#L29-L51
# but no thanks to Carthage for refusing to do simulator-only builds that would make all these keychain shenanigans unnecessary.
KEYCHAIN=ios-build.keychain
local password=cibuild
# Create a temporary keychain for code signing.
security create-keychain -p "$password" "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
security unlock-keychain -p "$password" "$KEYCHAIN"
security set-keychain-settings -t 3600 -l "$KEYCHAIN"
# Download the certificate for the Apple cert authority
local certpath="/tmp/apple_wwdr.cer"
curl 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer' > "$certpath"
security import "$certpath" -k "$KEYCHAIN" -T /usr/bin/codesign
# Import our development certificate.
security import ".ios-dev-cert.p12" -k "$KEYCHAIN" -P "$KEY_PASSWORD" -T /usr/bin/codesign
echo "Available identities after import:"
security find-identity
# ------ Tools ------
set -x
git clone https://github.com/supermarin/xcpretty.git /tmp/xcpretty
#brew update
#brew install carthage
# ------ Dependencies ------
# Optional pre-download, because builds are so slow on Travis, and Carthage builds _everything_:
echo "Downloading prebuilt dependencies"
curl https://innig.net/tmp/siesta-deps-swift3.tar.bz2 | bzcat | tar xv
# Uncomment to build with Carthage instead:
#echo "Building dependencies"
#carthage bootstrap --platform iOS,osx #--verbose
# ------ Project build (at last!) ------
if [[ "$platform" == "iOS Simulator" ]]; then
platform="$platform,OS=$ios_version,name=$ios_device"
fi
echo
echo —————— Running tests for $platform ...
echo
Siesta_DelayAfterEachSpec=1 \
Siesta_TestMultipleNetworkProviders=1 \
travis_retry xcodebuild test \
-project Siesta.xcodeproj \
-scheme "$scheme" \
-destination "platform=$platform" \
| /tmp/xcpretty/bin/xcpretty -c
buildresult=${PIPESTATUS[0]}
echo —————— Completed tests for $platform.
sleep 5 # Workaround for Travis log truncation
exit $buildresult