5
5
advanced-checkout :
vsco/[email protected]
6
6
7
7
commands :
8
+ install_node_modules :
9
+ parameters :
10
+ working_directory :
11
+ type : string
12
+ default : .
13
+ steps :
14
+ - restore_cache :
15
+ name : Restore Yarn Cache
16
+ keys :
17
+ - v0.2-node-modules-{{ checksum "<< parameters.working_directory >>/yarn.lock" }}
18
+ - run :
19
+ name : Install Node Modules
20
+ working_directory : << parameters.working_directory >>
21
+ command : yarn install --frozen-lockfile --cache-folder /tmp/.cache/yarn
22
+ - save_cache :
23
+ name : Save Yarn Cache
24
+ key : v0.2-node-modules-{{ checksum "<< parameters.working_directory >>/yarn.lock" }}
25
+ paths :
26
+ - /tmp/.cache/yarn
27
+
8
28
install_pods :
9
29
parameters :
10
30
working_directory :
37
57
- image : cimg/node:16.17.1
38
58
steps :
39
59
- advanced-checkout/shallow-checkout
40
- - run :
41
- name : Install Node Packages
42
- command : yarn
60
+ - install_node_modules
43
61
- run :
44
62
name : Check Format
45
63
command : yarn format
@@ -52,45 +70,22 @@ jobs:
52
70
- image : cimg/node:16.17.1
53
71
steps :
54
72
- advanced-checkout/shallow-checkout
55
-
56
- - run :
57
- name : Install Node Packages
58
- command : yarn
59
-
60
- - run :
61
- name : jest tests
62
- command : |
63
- mkdir -p test-results/jest
64
- yarn run test
65
- environment :
66
- JEST_JUNIT_OUTPUT : test-results/jest/junit.xml
67
-
68
- - persist_to_workspace :
69
- root : ~/project
70
- paths :
71
- - node_modules
72
-
73
- - store_test_results :
74
- path : test-results
75
-
76
- - store_artifacts :
77
- path : test-results
73
+ - install_node_modules
74
+ - run : yarn test
78
75
79
76
test_android :
80
77
executor :
81
78
name : android/android-machine
82
79
tag : ' 2022.03.1'
80
+ working_directory : ~/project/example
83
81
steps :
84
82
- advanced-checkout/shallow-checkout
85
83
- run :
86
84
name : Install Yarn
87
85
command : npm install -g yarn
88
- - run :
89
- name : Install Node Packages
90
- working_directory : example
91
- command : yarn
86
+ - install_node_modules
92
87
- android/run-tests :
93
- working-directory : ./example/ android
88
+ working-directory : android
94
89
test-command : ./gradlew test -PinstabugUploadEnable=false
95
90
96
91
validate_shell_files :
@@ -113,8 +108,9 @@ jobs:
113
108
xcode : 13.4.1
114
109
steps :
115
110
- advanced-checkout/shallow-checkout
116
- - run : yarn
117
- - run : cd example && yarn
111
+ - install_node_modules
112
+ - install_node_modules :
113
+ working_directory : example
118
114
- install_pods :
119
115
working_directory : example/ios
120
116
- run : git --no-pager diff
@@ -128,9 +124,7 @@ jobs:
128
124
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE : true
129
125
steps :
130
126
- advanced-checkout/shallow-checkout
131
- - run :
132
- name : Install node_modules
133
- command : yarn
127
+ - install_node_modules
134
128
- install_pods :
135
129
working_directory : ios
136
130
- run :
@@ -165,25 +159,15 @@ jobs:
165
159
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE : true
166
160
steps :
167
161
- advanced-checkout/shallow-checkout
168
- - run :
169
- name : Install React Native CLI
170
- command : npm install -g react-native-cli
171
162
- run :
172
163
name : Install Detox CLI
173
164
command : npm install -g detox-cli
174
165
- run :
175
166
name : Install Detox Utils
176
167
command : brew tap wix/brew && brew install applesimutils
177
- - run :
178
- name : Install Node Packages
179
- command : yarn
180
- - run :
181
- name : Build Project
182
- command : yarn build:lib
183
- - run :
184
- name : Install Example's Node Packages
168
+ - install_node_modules
169
+ - install_node_modules :
185
170
working_directory : example
186
- command : yarn
187
171
- install_pods :
188
172
working_directory : example/ios
189
173
- run :
@@ -204,20 +188,13 @@ jobs:
204
188
- advanced-checkout/shallow-checkout
205
189
- run :
206
190
name : Install Yarn
207
- command : npm install --global yarn
191
+ command : npm install -g yarn
208
192
- run :
209
193
name : Install Detox CLI
210
- command : npm install --global detox-cli
211
- - run :
212
- name : Install Node Packages
213
- command : yarn
214
- - run :
215
- name : Build Project
216
- command : yarn build:lib
217
- - run :
218
- name : Install Example's Node Packages
194
+ command : npm install -g detox-cli
195
+ - install_node_modules
196
+ - install_node_modules :
219
197
working_directory : example
220
- command : yarn
221
198
- android/create-avd :
222
199
avd-name : Nexus_6P_API_27
223
200
install : true
0 commit comments