forked from launchdarkly/ios-client-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
133 lines (114 loc) · 4.47 KB
/
config.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
129
130
131
132
133
version: 2.1
jobs:
build:
parameters:
xcode-version:
type: string
ios-sim:
type: string
ssh-fix:
type: boolean
default: true
build-doc:
type: boolean
default: false
run-lint:
type: boolean
default: false
shell: /bin/bash --login -eo pipefail
macos:
xcode: <<parameters.xcode-version>>
steps:
- checkout
# This hack shouldn't be necessary, as we don't actually use SSH
# to get any dependencies, but for some reason starting in the
# '12.0.0' Xcode image it's become necessary.
- when:
condition: <<parameters.ssh-fix>>
steps:
- run:
name: SSH fingerprint fix
command: |
sudo defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
rm ~/.ssh/id_rsa || true
for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
- run:
name: Setup for builds
command: |
mkdir -p 'test-results'
mkdir -p 'artifacts'
- run:
name: Build for macOS
command: xcodebuild build -scheme 'LaunchDarkly_macOS' -sdk macosx -destination 'platform=macOS' | tee 'artifacts/raw-logs-macosx.txt' | xcpretty -r junit -o 'test-results/platform-macosx/junit.xml'
when: always
- run:
name: Build Tests for iOS device
command: xcodebuild build-for-testing -scheme 'LaunchDarkly_iOS' -sdk iphoneos CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-iphoneos.txt' | xcpretty
when: always
- run:
name: Build & Test on iOS Simulator
command: xcodebuild test -scheme 'LaunchDarkly_iOS' -sdk iphonesimulator -destination '<<parameters.ios-sim>>' CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-iphonesimulator.txt' | xcpretty -r junit -o 'test-results/platform-iphonesimulator/junit.xml'
when: always
- run:
name: Build for tvOS device
command: xcodebuild build -scheme 'LaunchDarkly_tvOS' -sdk appletvos CODE_SIGN_IDENTITY= | tee 'artifacts/raw-logs-appletvos.txt' | xcpretty
when: always
- run:
name: Build for tvOS Simulator
command: xcodebuild build -scheme 'LaunchDarkly_tvOS' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | tee 'artifacts/raw-logs-appletvsimulator.txt' | xcpretty -r junit -o 'test-results/platform-appletvsimulator/junit.xml'
when: always
- run:
name: Build for watchOS simulator
command: xcodebuild build -scheme 'LaunchDarkly_watchOS' -sdk watchsimulator | tee 'artifacts/raw-logs-watchsimulator.txt' | xcpretty
when: always
- run:
name: Build for watchOS device
command: xcodebuild build -scheme 'LaunchDarkly_watchOS' -sdk watchos | tee 'artifacts/raw-logs-watchos.txt' | xcpretty
when: always
- run:
name: Build & Test with swiftpm
command: swift test -v 2>&1 | tee 'artifacts/raw-logs-swiftpm.txt' | xcpretty -r junit -o 'test-results/swiftpm/junit.xml'
when: always
- when:
condition: <<parameters.build-doc>>
steps:
- run:
name: Build Documentation
command: |
sudo gem install jazzy
jazzy -o artifacts/docs
- when:
condition: <<parameters.run-lint>>
steps:
- run:
name: CocoaPods spec lint
command: |
if [ "$CIRCLE_BRANCH" = 'master' ]; then
pod spec lint
else
pod lib lint
fi
- store_test_results:
path: test-results
- store_artifacts:
path: artifacts
workflows:
version: 2
build:
jobs:
- build:
name: Xcode 12.5 - Swift 5.4
xcode-version: '12.5.0'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.5'
build-doc: true
run-lint: true
- build:
name: Xcode 12.0 - Swift 5.3
xcode-version: '12.0.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
- build:
name: Xcode 11.4 - Swift 5.2
xcode-version: '11.4.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.2'
ssh-fix: false