@@ -18,37 +18,35 @@ 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
+ config for android e2e : &android_e2e
30
30
<< : *defaults
31
- resource_class : ' medium '
32
- macos :
33
- xcode : ' 11.5.0 '
31
+ resource_class : large
32
+ machine :
33
+ image : android:2022.06.2
34
34
35
35
default config for android apk builds : &android_defaults
36
36
<< : *defaults
37
37
docker :
38
- - image : reactnativecommunity/react-native-android
39
- resource_class : ' medium'
40
- working_directory : ~/async_storage
38
+ - image : cimg/android:2021.10.2-node # node 14.18.1
39
+ resource_class : medium
41
40
environment :
42
- - _JAVA_OPTIONS : ' -XX:+UnlockExperimentalVMOptions -Xmx2048m'
43
- - BUILD_THREADS : 2
41
+ JAVA_OPTIONS : ' -XX:+UnlockExperimentalVMOptions -Xmx2048m'
42
+ BUILD_THREADS : 2
44
43
45
44
# ==============================
46
45
# CACHE CONFIG
47
46
# ==============================
48
47
49
48
cache keys :
50
49
brew ios : &key_brew_ios cache-brew-ios-v5-{{ arch }}
51
- brew android : &key_brew_android cache-brew-android-v4-{{ arch }}
52
50
yarn : &key_yarn cache-yarn-{{ checksum "package.json" }}-{{ arch }}
53
51
gradle : &key_gradle cache-gradle-v2-{{ checksum "example/android/gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "package.json" }}-{{ arch }}
54
52
pods : &key_pods cache-pods-v0.64-{{ checksum "example/ios/Podfile" }}-{{ checksum "package.json" }}-{{ arch }}
@@ -66,17 +64,6 @@ cache:
66
64
keys :
67
65
- *key_brew_ios
68
66
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
67
# yarn
81
68
save yarn cache : &cache_save_yarn
82
69
name : Saving Yarn cache
@@ -229,71 +216,48 @@ jobs:
229
216
- example/android/app/build/outputs/apk/*
230
217
231
218
" Test: Android e2e " :
232
- << : *macos_defaults_android
219
+ << : *android_e2e
233
220
steps :
234
221
- *addWorkspace
235
222
- run :
236
- name : Configure env variables
223
+ name : " Install node v14.18.1 and yarn 1.22.17 "
237
224
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
- echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
242
- echo 'export JAVA_HOME=$(/usr/libexec/java_home)' >> $BASH_ENV
243
- source $BASH_ENV
244
- - restore-cache : *cache_restore_brew_android
225
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
226
+ source ~/.bashrc
227
+ nvm install v14.18.1
228
+ node -v
229
+ npm install --global yarn@1.22.17
230
+ yarn -v
231
+ - restore_cache : *cache_restore_yarn
245
232
- 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
233
+ name : Install dependencies
234
+ command : yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
235
+ - save_cache : *cache_save_yarn
251
236
- run :
252
- name : Install Android emulator
253
- shell : /bin/bash -e
237
+ name : Configure Environment Variables
254
238
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
239
+ echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
240
+ echo 'export PATH="$PATH:~/async_storage/node_modules/.bin"' >> $BASH_ENV
241
+ source $BASH_ENV
261
242
- run :
262
- name : ADB start/stop
243
+ name : Install Android system image
263
244
command : |
264
- adb start-server
265
- adb devices
266
- adb kill-server
267
- ls -la ~/.android
245
+ sdkmanager "system-images;android-30;default;x86_64"
268
246
- run :
269
- name : Create emulator
247
+ name : " Create Android emulator"
270
248
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"
249
+ avdmanager create avd -n E2E_API_30 -d pixel_4 --package "system-images;android-30;default;x86_64"
276
250
- run :
277
- name : Start emulator in background
278
- background : true
251
+ name : Launch emulator
279
252
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:*'
253
+ emulator -avd E2E_API_30 -delay-adb -verbose -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
254
+ background : true
255
+ - run :
256
+ name : " Make sure TestButler apk is present"
257
+ command : ./scripts/android_e2e.sh 'install_test_butler'
290
258
- run :
291
259
name : Wait for emulator to boot
292
260
command : ./scripts/android_e2e.sh 'wait_for_emulator'
293
- - run :
294
- name : Wake device
295
- command : |
296
- adb shell input keyevent 82
297
261
- run :
298
262
name : Run e2e tests
299
263
command : yarn test:e2e:android
0 commit comments