Skip to content

Commit cb0d389

Browse files
authored
[MOB-12053] Use node CI Orb (#946)
By using the node orb, we benefit from the following: 1. Default machine executors. 2. Caching node_modules.
1 parent d8003a8 commit cb0d389

File tree

1 file changed

+51
-44
lines changed

1 file changed

+51
-44
lines changed

.circleci/config.yml

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: 2.1
33
orbs:
44
android: circleci/[email protected]
55
advanced-checkout: vsco/[email protected]
6+
node: circleci/[email protected]
67

78
commands:
89
install_pods:
@@ -33,13 +34,12 @@ jobs:
3334
- run: bundle exec danger
3435

3536
lint:
36-
docker:
37-
- image: cimg/node:16.17.1
37+
executor:
38+
name: node/default
3839
steps:
3940
- advanced-checkout/shallow-checkout
40-
- run:
41-
name: Install Node Packages
42-
command: yarn
41+
- node/install-packages:
42+
pkg-manager: yarn
4343
- run:
4444
name: Check Format
4545
command: yarn format
@@ -48,13 +48,12 @@ jobs:
4848
command: yarn lint:ci
4949

5050
test_module:
51-
docker:
52-
- image: cimg/node:16.17.1
51+
executor:
52+
name: node/default
5353
steps:
5454
- advanced-checkout/shallow-checkout
55-
- run:
56-
name: Install Node Packages
57-
command: yarn
55+
- node/install-packages:
56+
pkg-manager: yarn
5857
- run:
5958
name: Run Tests
6059
command: yarn test
@@ -63,17 +62,14 @@ jobs:
6362
executor:
6463
name: android/android-machine
6564
tag: '2022.03.1'
65+
working_directory: ~/project/example
6666
steps:
6767
- advanced-checkout/shallow-checkout
68-
- run:
69-
name: Install Yarn
70-
command: npm install -g yarn
71-
- run:
72-
name: Install Node Packages
73-
working_directory: example
74-
command: yarn
68+
- node/install-yarn
69+
- node/install-packages:
70+
pkg-manager: yarn
7571
- android/run-tests:
76-
working-directory: ./example/android
72+
working-directory: android
7773
test-command: ./gradlew test -PinstabugUploadEnable=false
7874

7975
validate_shell_files:
@@ -96,8 +92,11 @@ jobs:
9692
xcode: 13.4.1
9793
steps:
9894
- advanced-checkout/shallow-checkout
99-
- run: yarn
100-
- run: cd example && yarn
95+
- node/install-packages:
96+
pkg-manager: yarn
97+
- node/install-packages:
98+
pkg-manager: yarn
99+
app-dir: example
101100
- install_pods:
102101
working_directory: example/ios
103102
- run: git --no-pager diff
@@ -111,9 +110,8 @@ jobs:
111110
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
112111
steps:
113112
- advanced-checkout/shallow-checkout
114-
- run:
115-
name: Install node_modules
116-
command: yarn
113+
- node/install-packages:
114+
pkg-manager: yarn
117115
- install_pods:
118116
working_directory: ios
119117
- run:
@@ -147,21 +145,23 @@ jobs:
147145
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
148146
steps:
149147
- advanced-checkout/shallow-checkout
148+
- node/install-packages:
149+
pkg-manager: yarn
150+
- node/install-packages:
151+
pkg-manager: yarn
152+
app-dir: example
153+
- install_pods:
154+
working_directory: example/ios
150155
- run:
151156
name: Install Detox CLI
152157
command: npm install -g detox-cli
153158
- run:
154159
name: Install Detox Utils
155160
command: brew tap wix/brew && brew install applesimutils
156161
- run:
157-
name: Install Node Packages
158-
command: yarn
159-
- run:
160-
name: Install Example's Node Packages
162+
name: Rebuild Detox.framework Cache
161163
working_directory: example
162-
command: yarn
163-
- install_pods:
164-
working_directory: example/ios
164+
command: detox clean-framework-cache && detox build-framework-cache
165165
- run:
166166
name: Detox - Build Release App
167167
working_directory: example
@@ -178,19 +178,15 @@ jobs:
178178
resource-class: large
179179
steps:
180180
- advanced-checkout/shallow-checkout
181-
- run:
182-
name: Install Yarn
183-
command: npm install -g yarn
181+
- node/install-yarn
182+
- node/install-packages:
183+
pkg-manager: yarn
184+
- node/install-packages:
185+
pkg-manager: yarn
186+
app-dir: example
184187
- run:
185188
name: Install Detox CLI
186189
command: npm install -g detox-cli
187-
- run:
188-
name: Install Node Packages
189-
command: yarn
190-
- run:
191-
name: Install Example's Node Packages
192-
working_directory: example
193-
command: yarn
194190
- android/create-avd:
195191
avd-name: Nexus_6P_API_27
196192
install: true
@@ -215,10 +211,21 @@ jobs:
215211
steps:
216212
- advanced-checkout/shallow-checkout
217213
- run: git clone [email protected]:Instabug/Escape.git
218-
- run: cd Escape && swift build -c release
219-
- run: cd Escape/.build/release && cp -f Escape /usr/local/bin/escape
220-
- run: cd project && yarn && yarn build
221-
- run: cd project && Escape react-native publish
214+
- run:
215+
working_directory: Escape
216+
command: swift build -c release
217+
- run:
218+
working_directory: Escape/.build/release
219+
command: cp -f Escape /usr/local/bin/escape
220+
- node/install-packages:
221+
pkg-manager: yarn
222+
app-dir: project
223+
- run:
224+
working_directory: project
225+
command: yarn build
226+
- run:
227+
working_directory: project
228+
command: Escape react-native publish
222229

223230
workflows:
224231
publish:

0 commit comments

Comments
 (0)