This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
forked from bustoutsolutions/siesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
108 lines (82 loc) · 4.07 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
branches:
only:
- master
- travis
- swift-5
language: objective-c
os: osx
osx_image: xcode10.2
env:
- scheme='Siesta macOS' platform='OS X'
- scheme='Siesta iOS' platform='iOS Simulator' sim_os='iOS' sim_os_version='12.0' sim_device='iPhone XR'
- scheme='Siesta iOS' platform='iOS Simulator' sim_os='iOS' sim_os_version='11.1' sim_device='iPhone SE'
- scheme='Siesta iOS' platform='iOS Simulator' sim_os='iOS' sim_os_version='9.3' sim_device='iPhone 6'
# As of XC 9.4, any framework tests (not just Siesta) fail on iOS 8.1 simulator with
# "Timed out trying to establish connection to IDE" (radar 40756466). Reenable this if Apple fixes:
#- scheme='Siesta iOS' platform='iOS Simulator' sim_os='iOS' sim_os_version='8.1' sim_device='iPhone 4s'
# For now, using 9.3 on 4s instead (which is important bc some bugs are 32-bit-specific):
- scheme='Siesta iOS' platform='iOS Simulator' sim_os='iOS' sim_os_version='9.3' sim_device='iPhone 4s'
- scheme='Siesta tvOS' platform='tvOS Simulator' sim_os='tvOS' sim_os_version='12.1' sim_device='Apple TV 1080p'
before_install: |
set -x
if [[ "$platform" =~ \ Simulator$ ]]; then
sim_simulator_udid=$(
xcrun simctl create "Siesta testing device" \
"com.apple.CoreSimulator.SimDeviceType.${sim_device// /-}" \
"com.apple.CoreSimulator.SimRuntime.${sim_os}-${sim_os_version//./-}"
)
echo "Prelaunching iOS simulator with UDID $sim_simulator_udid"
xcrun simctl boot $sim_simulator_udid
# Working for “Library not loaded: /usr/lib/libauto.dylib”; see:
# https://stackoverflow.com/questions/55389080/xcode-10-2-failed-to-run-app-on-simulator-with-ios-10
# https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_1_release_notes
sudo mkdir "/Library/Developer/CoreSimulator/Profiles/Runtimes/${sim_os} ${sim_os_version}.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift"
fi
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-swift-5.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" =~ \ Simulator$ ]]; then
platform="$platform,OS=$sim_os_version,name=Siesta testing device"
fi
echo
echo —————— Running tests for $platform ...
echo
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