@@ -18,37 +18,26 @@ checkout step for each job: &addWorkspace
18
18
default config for js : &js_defaults
19
19
<< : *defaults
20
20
docker :
21
- - image : circleci /node:14
21
+ - image : cimg /node:14.18.1
22
22
23
23
default config for macOS : &macos_defaults
24
24
<< : *defaults
25
25
resource_class : ' medium'
26
26
macos :
27
- xcode : ' 13.2.1 '
27
+ xcode : ' 13.1.0 '
28
28
29
- config for macOS ( android) : &macos_defaults_android
29
+ default config for android apk tests : &android_defaults
30
30
<< : *defaults
31
- resource_class : ' medium'
32
- macos :
33
- xcode : ' 11.5.0'
34
-
35
- default config for android apk builds : &android_defaults
36
- << : *defaults
37
- docker :
38
- - image : reactnativecommunity/react-native-android
39
- resource_class : ' medium'
40
- working_directory : ~/async_storage
41
- environment :
42
- - _JAVA_OPTIONS : ' -XX:+UnlockExperimentalVMOptions -Xmx2048m'
43
- - BUILD_THREADS : 2
31
+ resource_class : large
32
+ machine :
33
+ image : android:2022.06.2
44
34
45
35
# ==============================
46
36
# CACHE CONFIG
47
37
# ==============================
48
38
49
39
cache keys :
50
40
brew ios : &key_brew_ios cache-brew-ios-v5-{{ arch }}
51
- brew android : &key_brew_android cache-brew-android-v4-{{ arch }}
52
41
yarn : &key_yarn cache-yarn-{{ checksum "package.json" }}-{{ arch }}
53
42
gradle : &key_gradle cache-gradle-v2-{{ checksum "example/android/gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "package.json" }}-{{ arch }}
54
43
pods : &key_pods cache-pods-v0.64-{{ checksum "example/ios/Podfile" }}-{{ checksum "package.json" }}-{{ arch }}
@@ -66,17 +55,6 @@ cache:
66
55
keys :
67
56
- *key_brew_ios
68
57
69
- save brew cache for android : &cache_save_brew_android
70
- name : Saving Brew cache for android
71
- paths :
72
- - ~/Library/Caches/Homebrew
73
- key : *key_brew_android
74
-
75
- restore brew cache for android : &cache_restore_brew_android
76
- name : Restoring Brew cache for android
77
- keys :
78
- - *key_brew_android
79
-
80
58
# yarn
81
59
save yarn cache : &cache_save_yarn
82
60
name : Saving Yarn cache
@@ -209,10 +187,24 @@ jobs:
209
187
name : Run e2e tests
210
188
command : yarn test:e2e:ios
211
189
212
- " Build : Android release apk " :
190
+ " Test : Android e2e " :
213
191
<< : *android_defaults
214
192
steps :
215
193
- *addWorkspace
194
+ - run :
195
+ name : " Install node v14.18.1 and yarn 1.22.17"
196
+ command : |
197
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
198
+ source ~/.bashrc
199
+ nvm install v14.18.1
200
+ node -v
201
+ npm install --global [email protected]
202
+ yarn -v
203
+ - restore_cache : *cache_restore_yarn
204
+ - run :
205
+ name : Install dependencies
206
+ command : yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
207
+ - save_cache : *cache_save_yarn
216
208
- run :
217
209
name : Bundle JS
218
210
command : yarn bundle:android --dev false
@@ -223,77 +215,31 @@ jobs:
223
215
name : Build APK with Next storage
224
216
working_directory : example/android
225
217
command : ./gradlew assembleNext --max-workers 2
226
- - persist_to_workspace :
227
- root : ~/async_storage
228
- paths :
229
- - example/android/app/build/outputs/apk/*
230
-
231
- " Test: Android e2e " :
232
- << : *macos_defaults_android
233
- steps :
234
- - *addWorkspace
235
218
- run :
236
- name : Configure env variables
219
+ name : Configure Environment Variables
237
220
command : |
238
- echo 'export ANDROID_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
239
- echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV
240
- echo 'export PATH="$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH"' >> $BASH_ENV
241
221
echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
242
- echo 'export JAVA_HOME=$(/usr/libexec/java_home) ' >> $BASH_ENV
222
+ echo 'export PATH="$PATH:~/async_storage/node_modules/.bin" ' >> $BASH_ENV
243
223
source $BASH_ENV
244
- - restore-cache : *cache_restore_brew_android
245
- - run :
246
- name : Install Android SDK tools
247
- command : |
248
- brew update --preinstall
249
- brew bundle --file=.circleci/Brewfile.android --no-lock
250
- - save-cache : *cache_save_brew_android
251
224
- run :
252
- name : Install Android emulator
253
- shell : /bin/bash -e
225
+ name : Install Android system image
254
226
command : |
255
- yes | sdkmanager "platform-tools" "tools" 1> /dev/null
256
- yes | sdkmanager "platforms;android-28" "system-images;android-28;default;x86_64" 1> /dev/null
257
- yes | sdkmanager "emulator" --channel=3 1> /dev/null
258
- yes | sdkmanager "build-tools;28.0.3" 1> /dev/null
259
- yes | sdkmanager --licenses 1> /dev/null
260
- yes | sdkmanager --list
227
+ sdkmanager "system-images;android-30;default;x86_64"
261
228
- run :
262
- name : ADB start/stop
229
+ name : " Create Android emulator "
263
230
command : |
264
- adb start-server
265
- adb devices
266
- adb kill-server
267
- ls -la ~/.android
231
+ avdmanager create avd -n E2E_API_30 -d pixel_4 --package "system-images;android-30;default;x86_64"
268
232
- run :
269
- name : Create emulator
233
+ name : Launch emulator
270
234
command : |
271
- avdmanager create avd --force \
272
- -n "Emu_E2E" \
273
- -k "system-images;android-28;default;x86_64" \
274
- -g "default" \
275
- -d "pixel"
276
- - run :
277
- name : Start emulator in background
235
+ emulator -avd E2E_API_30 -delay-adb -verbose -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
278
236
background : true
279
- command : |
280
- emulator -avd "Emu_E2E" \
281
- -cores 1 \
282
- -gpu auto \
283
- -accel on \
284
- -memory 1024 \
285
- -no-audio \
286
- -no-snapshot \
287
- -no-boot-anim \
288
- -no-window \
289
- -logcat '*:E ReactNative:W ReactNativeJS:*'
237
+ - run :
238
+ name : " Make sure TestButler apk is present"
239
+ command : ./scripts/android_e2e.sh 'install_test_butler'
290
240
- run :
291
241
name : Wait for emulator to boot
292
242
command : ./scripts/android_e2e.sh 'wait_for_emulator'
293
- - run :
294
- name : Wake device
295
- command : |
296
- adb shell input keyevent 82
297
243
- run :
298
244
name : Run e2e tests
299
245
command : yarn test:e2e:android
@@ -333,14 +279,11 @@ workflows:
333
279
requires :
334
280
- " Test: lint"
335
281
- " Test: TypeScript"
336
- - " Build : Android release apk " :
282
+ - " Test : Android e2e " :
337
283
requires :
338
284
- " Test: lint"
339
285
- " Test: TypeScript"
340
286
- " Test: Android unit"
341
- - " Test: Android e2e " :
342
- requires :
343
- - " Build: Android release apk"
344
287
- " Release " :
345
288
requires :
346
289
- " Test: iOS e2e"
0 commit comments