Skip to content

Commit acc697a

Browse files
committed
Use node Orb
1 parent 42f4746 commit acc697a

File tree

1 file changed

+50
-49
lines changed

1 file changed

+50
-49
lines changed

.circleci/config.yml

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

78
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-
289
install_pods:
2910
parameters:
3011
working_directory:
@@ -53,11 +34,12 @@ jobs:
5334
- run: bundle exec danger
5435

5536
lint:
56-
docker:
57-
- image: cimg/node:16.17.1
37+
executor:
38+
name: node/default
5839
steps:
5940
- advanced-checkout/shallow-checkout
60-
- install_node_modules
41+
- node/install-packages:
42+
pkg-manager: yarn
6143
- run:
6244
name: Check Format
6345
command: yarn format
@@ -66,11 +48,12 @@ jobs:
6648
command: yarn lint:ci
6749

6850
test_module:
69-
docker:
70-
- image: cimg/node:16.17.1
51+
executor:
52+
name: node/default
7153
steps:
7254
- advanced-checkout/shallow-checkout
73-
- install_node_modules
55+
- node/install-packages:
56+
pkg-manager: yarn
7457
- run:
7558
name: Run Tests
7659
command: yarn test
@@ -82,10 +65,9 @@ jobs:
8265
working_directory: ~/project/example
8366
steps:
8467
- advanced-checkout/shallow-checkout
85-
- run:
86-
name: Install Yarn
87-
command: npm install -g yarn
88-
- install_node_modules
68+
- node/install-yarn
69+
- node/install-packages:
70+
pkg-manager: yarn
8971
- android/run-tests:
9072
working-directory: android
9173
test-command: ./gradlew test -PinstabugUploadEnable=false
@@ -110,9 +92,11 @@ jobs:
11092
xcode: 13.4.1
11193
steps:
11294
- advanced-checkout/shallow-checkout
113-
- install_node_modules
114-
- install_node_modules:
115-
working_directory: example
95+
- node/install-packages:
96+
pkg-manager: yarn
97+
- node/install-packages:
98+
pkg-manager: yarn
99+
app-dir: example
116100
- install_pods:
117101
working_directory: example/ios
118102
- run: git --no-pager diff
@@ -126,7 +110,8 @@ jobs:
126110
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
127111
steps:
128112
- advanced-checkout/shallow-checkout
129-
- install_node_modules
113+
- node/install-packages:
114+
pkg-manager: yarn
130115
- install_pods:
131116
working_directory: ios
132117
- run:
@@ -160,17 +145,22 @@ jobs:
160145
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
161146
steps:
162147
- 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
163155
- run:
164156
name: Install Detox CLI
165157
command: npm install -g detox-cli
166158
- run:
167159
name: Install Detox Utils
168160
command: brew tap wix/brew && brew install applesimutils
169-
- install_node_modules
170-
- install_node_modules:
171-
working_directory: example
172-
- install_pods:
173-
working_directory: example/ios
161+
- run:
162+
name: Rebuild Detox.framework Cache
163+
command: detox clean-framework-cache && detox build-framework-cache
174164
- run:
175165
name: Detox - Build Release App
176166
working_directory: example
@@ -187,15 +177,15 @@ jobs:
187177
resource-class: large
188178
steps:
189179
- advanced-checkout/shallow-checkout
190-
- run:
191-
name: Install Yarn
192-
command: npm install -g yarn
180+
- node/install-yarn
181+
- node/install-packages:
182+
pkg-manager: yarn
183+
- node/install-packages:
184+
pkg-manager: yarn
185+
app-dir: example
193186
- run:
194187
name: Install Detox CLI
195188
command: npm install -g detox-cli
196-
- install_node_modules
197-
- install_node_modules:
198-
working_directory: example
199189
- android/create-avd:
200190
avd-name: Nexus_6P_API_27
201191
install: true
@@ -220,10 +210,21 @@ jobs:
220210
steps:
221211
- advanced-checkout/shallow-checkout
222212
- run: git clone [email protected]:Instabug/Escape.git
223-
- run: cd Escape && swift build -c release
224-
- run: cd Escape/.build/release && cp -f Escape /usr/local/bin/escape
225-
- run: cd project && yarn && yarn build
226-
- run: cd project && Escape react-native publish
213+
- run:
214+
working_directory: Escape
215+
command: swift build -c release
216+
- run:
217+
working_directory: Escape/.build/release
218+
command: cp -f Escape /usr/local/bin/escape
219+
- node/install-packages:
220+
pkg-manager: yarn
221+
app-dir: project
222+
- run:
223+
working_directory: project
224+
command: yarn build
225+
- run:
226+
working_directory: project
227+
command: Escape react-native publish
227228

228229
workflows:
229230
publish:

0 commit comments

Comments
 (0)