-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathconfig.yml
More file actions
265 lines (250 loc) · 7.85 KB
/
Copy pathconfig.yml
File metadata and controls
265 lines (250 loc) · 7.85 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
version: 2.1
orbs:
platform-helpers: okta/platform-helpers@1
general-platform-helpers: okta/general-platform-helpers@1.9
macos: circleci/macos@2
executors:
apple-ci-arm-medium:
macos:
xcode: "26.2.0"
resource_class: m4pro.medium
commands:
prepare-ios-simulator:
steps:
- macos/preboot-simulator:
version: "18.6"
platform: "iOS"
device: "iPhone 16 Pro Max"
prepare-tvos-simulator:
steps:
- macos/preboot-simulator:
version: "18.5"
platform: "tvOS"
device: "Apple TV"
ui-test:
parameters:
scheme:
type: string
sdk:
type: string
default: iphonesimulator
platform:
type: string
default: "iOS Simulator"
xcode-options:
type: string
default: ""
steps:
- run: xcodebuild -version
- run:
name: "Install test utilities"
command: |
if ! which -s xcresulttool; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew tap a7ex/homebrew-formulae
brew install xcresultparser xcbeautify
fi
mkdir -p /tmp/TestResults
- run:
name: "Define destination"
command: |
if [[ "<<parameters.platform>>" == "macOS" ]]; then
export DESTINATION="platform=<<parameters.platform>>,arch=arm64"
elif [[ -n $MACOS_ORB_DEVICE_UDID ]]; then
export DESTINATION="platform=<<parameters.platform>>,id=$MACOS_ORB_DEVICE_UDID"
else
export DESTINATION="platform=<<parameters.platform>>"
fi
echo "export DESTINATION=\"$DESTINATION\"" >> "$BASH_ENV"
echo "Running on $DESTINATION"
- run:
name: "Build <<parameters.scheme>>"
environment:
NSUnbufferedIO: YES
command: |
echo "Building for $DESTINATION"
set -o pipefail && \
xcrun xcodebuild \
-derivedDataPath /tmp/Build/DerivedData \
-clonedSourcePackagesDirPath /tmp/Build/ClonedSources \
-workspace OktaClient.xcworkspace \
-scheme "<<parameters.scheme>>" \
-sdk <<parameters.sdk>> \
-destination "$DESTINATION" \
<<parameters.xcode-options>> \
build-for-testing 2>&1 | \
tee -a "/tmp/TestResults/<<parameters.scheme>>-<<parameters.platform>>.log" | \
xcbeautify
- when:
condition:
and:
- not:
equal: [ macOS, <<parameters.platform>> ]
steps:
- macos/wait-until-simulator-booted
- run:
name: "Test <<parameters.scheme>>"
environment:
NSUnbufferedIO: YES
command: |
echo "Testing $DESTINATION"
set -o pipefail && \
xcrun xcodebuild \
-derivedDataPath /tmp/Build/DerivedData \
-clonedSourcePackagesDirPath /tmp/Build/ClonedSources \
-resultBundlePath "/tmp/TestResults/<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult" \
-workspace OktaClient.xcworkspace \
-scheme "<<parameters.scheme>>" \
-sdk <<parameters.sdk>> \
-destination "$DESTINATION" \
<<parameters.xcode-options>> \
test-without-building 2>&1 | \
tee -a "/tmp/TestResults/<<parameters.scheme>>-<<parameters.platform>>.log" | \
xcbeautify
- run:
name: "Export test results"
when: always
command: |
mkdir -p /tmp/junit-results
if [[ -d "/tmp/TestResults/<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult" ]]; then
xcresultparser -o junit "/tmp/TestResults/<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult" > "/tmp/junit-results/<<parameters.scheme>>.xml"
fi
- run:
name: "Compress test results"
when: always
command: |
cd /tmp/TestResults
if [[ -d "<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult" ]]; then
zip -r "<<parameters.scheme>> #$CIRCLE_BUILD_NUM.zip" "<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult"
rm -rf "<<parameters.scheme>> #$CIRCLE_BUILD_NUM.xcresult"
fi
- store_test_results:
path: "/tmp/junit-results/<<parameters.scheme>>.xml"
jobs:
setup:
executor: apple-ci-arm-medium
steps:
- checkout
- run:
name: "Store configuration files"
command: |
printenv TEST_OKTA_PLIST | base64 -d -i - > ~/project/Samples/Shared/Okta.plist
printenv TEST_CONFIGURATION | base64 -d -i - > ~/project/Samples/Shared/TestConfiguration.xcconfig
- persist_to_workspace:
root: ~/project
paths:
- .
test-websignin-ios:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- prepare-ios-simulator
- ui-test:
scheme: "WebSignIn (iOS)"
- ui-test:
scheme: "SingleSignOn (iOS)"
- store_artifacts:
path: "/tmp/TestResults"
test-directauth-ios:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- prepare-ios-simulator
- ui-test:
scheme: "DirectAuthSignIn (iOS)"
- store_artifacts:
path: "/tmp/TestResults"
test-deviceauthsignin-ios:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- prepare-ios-simulator
- ui-test:
scheme: "DeviceAuthSignIn (iOS)"
- store_artifacts:
path: "/tmp/TestResults"
test-deviceauthsignin-tvos:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- prepare-tvos-simulator
- ui-test:
scheme: "DeviceAuthSignIn (tvOS)"
sdk: appletvsimulator
platform: "tvOS Simulator"
- store_artifacts:
path: "/tmp/TestResults"
test-userpasswordsignin-macos:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- ui-test:
scheme: "UserPasswordSignIn (macOS)"
sdk: macosx
platform: "macOS"
xcode-options: 'CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO'
- store_artifacts:
path: "/tmp/TestResults"
test-classicnativeauth-ios:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- prepare-ios-simulator
- ui-test:
scheme: "ClassicNativeAuth (iOS)"
- store_artifacts:
path: "/tmp/TestResults"
snyk-scan:
executor: apple-ci-arm-medium
steps:
- attach_workspace:
at: ~/project
- macos/install-rosetta
- run:
name: run swift package show dependencies
command: swift package show-dependencies
- general-platform-helpers/step-run-snyk-monitor:
scan-all-projects: true
skip-unresolved: false
os: macos
workflows:
ui-tests:
jobs:
- setup
- test-websignin-ios:
requires:
- setup
- test-directauth-ios:
requires:
- setup
- test-deviceauthsignin-ios:
requires:
- setup
- test-deviceauthsignin-tvos:
requires:
- setup
- test-userpasswordsignin-macos:
requires:
- setup
- test-classicnativeauth-ios:
requires:
- setup
security-scan:
jobs:
- setup:
filters:
branches:
only:
- master
- snyk-scan:
name: execute-snyk
context:
- static-analysis
requires:
- setup