@@ -6,6 +6,8 @@ defaults: &defaults
6
6
macos :
7
7
xcode : " 11.2.1"
8
8
working_directory : ~/amplify-ios
9
+ environment :
10
+ BUNDLE_PATH : vendor/bundle
9
11
10
12
references :
11
13
repo_cache_key : &repo_cache_key
@@ -38,9 +40,22 @@ commands:
38
40
pre start simulator, build may fail if simulator is not started
39
41
steps :
40
42
- run :
41
- name : pre -start simulator
43
+ name : Pre -start simulator
42
44
command : bash ~/amplify-ios/CircleciScripts/pre_start_simulator.sh
43
45
46
+ restore_gems :
47
+ steps :
48
+ - restore_cache :
49
+ keys :
50
+ - v1-gems-{{ checksum "~/amplify-ios/Gemfile.lock" }}
51
+ - v1-gems-
52
+
53
+ check_bundle :
54
+ steps :
55
+ - run :
56
+ name : Check bundle
57
+ command : bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH
58
+
44
59
save_plugin_pods :
45
60
parameters :
46
61
prefix :
@@ -71,20 +86,40 @@ jobs:
71
86
key : *repo_cache_key
72
87
paths :
73
88
- ~/amplify-ios
89
+
90
+ install_gems :
91
+ << : *defaults
92
+ steps :
93
+ - *restore_repo
94
+ - restore_gems
95
+ - run :
96
+ name : Bundle install
97
+ command : bundle check --path $BUNDLE_PATH || bundle install --path $BUNDLE_PATH
98
+ environment :
99
+ BUNDLE_JOBS : 4
100
+ BUNDLE_RETRY : 3
101
+ - save_cache :
102
+ key : v1-gems-{{ checksum "~/amplify-ios/Gemfile.lock" }}
103
+ paths :
104
+ - vendor/bundle
74
105
75
106
build_test_amplify :
76
107
<< : *defaults
77
108
steps :
78
109
- *restore_repo
79
110
- pre_start_simulator
80
111
- run : pod install
112
+ - restore_gems
113
+ - check_bundle
81
114
- run :
82
- name : build amplify
83
- command : xcodebuild build -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}"
115
+ name : Build amplify
116
+ command : xcodebuild build-for-testing -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}" | xcpretty
84
117
- run :
85
- name : test amplify
86
- command : xcodebuild test -enableThreadSanitizer NO -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}"
87
-
118
+ name : Test amplify
119
+ command : xcodebuild test -enableThreadSanitizer NO -workspace Amplify.xcworkspace -scheme Amplify -sdk iphonesimulator -destination "${destination}" | xcpretty --simple --color --report junit
120
+ - store_test_results :
121
+ path : build/reports
122
+
88
123
plugin_unit_test :
89
124
<< : *defaults
90
125
parameters :
@@ -104,72 +139,93 @@ jobs:
104
139
- run : pod install
105
140
- save_plugin_pods :
106
141
prefix : << parameters.path >>
107
-
142
+ - restore_gems
143
+ - check_bundle
108
144
- run :
109
- name : build << parameters.path >>
110
- command : xcodebuild build-for-testing -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}"
145
+ name : Build << parameters.path >>
146
+ command : xcodebuild build-for-testing -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}" | xcpretty
147
+ - run :
148
+ name : Test << parameters.path >>
149
+ command : xcodebuild test -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}" | xcpretty --simple --color --report junit
150
+ - store_test_results :
151
+ path : build/reports
152
+
153
+ deploy :
154
+ << : *defaults
155
+ description : deploy pods to trunk
156
+ steps :
157
+ - *restore_repo
158
+ - restore_gems
159
+ - check_bundle
160
+ # - run:
161
+ # name: Bump pod versions
162
+ # command: bundle exec fastlane bump_podspecs_patch
111
163
- run :
112
- name : test << parameters.path >>
113
- command : xcodebuild test -workspace << parameters.workspace >>.xcworkspace -scheme << parameters.scheme >> -sdk iphonesimulator -destination "${destination}"
164
+ name : Release pods
165
+ command : bundle exec fastlane release_pods
166
+
114
167
115
168
workflows :
116
- build_test :
169
+ build_test_deploy :
117
170
jobs :
118
171
- checkout_code
119
- # Running all the tests in parallel leads to threading issues
120
- # Breaking them up into 2 groups :
121
- # Group 1
172
+ - install_gems :
173
+ requires :
174
+ - checkout_code
122
175
- build_test_amplify :
123
176
requires :
124
- - checkout_code
177
+ - install_gems
125
178
- plugin_unit_test :
126
179
name : unit_test_api
127
180
path : API
128
181
workspace : APICategoryPlugin
129
182
scheme : AWSAPICategoryPlugin
130
183
requires :
131
- - checkout_code
184
+ - install_gems
132
185
- plugin_unit_test :
133
186
name : unit_test_analytics
134
187
path : Analytics
135
188
workspace : AnalyticsCategoryPlugin
136
189
scheme : AWSPinpointAnalyticsPlugin
137
190
requires :
138
- - checkout_code
191
+ - install_gems
139
192
- plugin_unit_test :
140
193
name : unit_test_storage
141
194
path : Storage
142
195
workspace : StoragePlugin
143
196
scheme : AWSS3StoragePlugin
144
197
requires :
145
- - build_test_amplify
146
- - unit_test_api
147
- - unit_test_analytics
198
+ - install_gems
148
199
- plugin_unit_test :
149
200
name : unit_test_predictions
150
201
path : Predictions
151
202
workspace : PredictionsCategoryPlugin
152
203
scheme : AWSPredictionsPlugin
153
204
requires :
154
- - build_test_amplify
155
- - unit_test_api
156
- - unit_test_analytics
205
+ - install_gems
157
206
- plugin_unit_test :
158
- name : unit_test_predictions_core_ml
207
+ name : unit_test_core_ml
159
208
path : Predictions
160
209
workspace : PredictionsCategoryPlugin
161
210
scheme : CoreMLPredictionsPlugin
162
211
requires :
163
- - build_test_amplify
164
- - unit_test_api
165
- - unit_test_analytics
166
- # - plugin_unit_test:
167
- # name: unit_test_datastore
168
- # path: DataStore
169
- # workspace: DataStoreCategoryPlugin
170
- # scheme: AWSDataStoreCategoryPlugin
171
- # requires:
172
- # - build_test_amplify
173
- # - unit_test_api
174
- # - unit_test_analytics
175
- # - unit_test_storage
212
+ - install_gems
213
+ - plugin_unit_test :
214
+ name : unit_test_datastore
215
+ path : DataStore
216
+ workspace : DataStoreCategoryPlugin
217
+ scheme : AWSDataStoreCategoryPlugin
218
+ requires :
219
+ - install_gems
220
+ - deploy :
221
+ filters :
222
+ branches :
223
+ only :
224
+ - release
225
+ requires :
226
+ - build_test_amplify
227
+ - unit_test_api
228
+ - unit_test_analytics
229
+ - unit_test_storage
230
+ - unit_test_predictions
231
+ - unit_test_datastore
0 commit comments