Skip to content

Commit f64c945

Browse files
committed
ci: Fix builds failing with Xcode 12
Note that this does not fix tests failing to run on Xcode 12. EarlGrey, which is what Detox depends on, crashes when run on iOS 14 (google/EarlGrey#1447). We may be required to bump to latest Detox to solve this issue, but it will require more work on our side.
1 parent 679c6d5 commit f64c945

File tree

5 files changed

+1371
-1216
lines changed

5 files changed

+1371
-1216
lines changed

.circleci/Brewfile.android

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tap 'homebrew/cask'
2+
cask 'android-sdk'
3+
cask 'intel-haxm'

.circleci/Brewfile.ios

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tap 'wix/brew'
2+
brew 'applesimutils'
3+
brew 'cocoapods'

.circleci/config.yml

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ checkout step for each job: &addWorkspace
1818
default config for js: &js_defaults
1919
<<: *defaults
2020
docker:
21-
- image: circleci/node:10
21+
- image: circleci/node:12
2222

2323
default config for macOS: &macos_defaults
2424
<<: *defaults
2525
resource_class: 'medium'
2626
macos:
27-
xcode: '10.1.0'
27+
xcode: '11.7.0'
2828

2929
default config for android apk builds: &android_defaults
3030
<<: *defaults
@@ -41,31 +41,6 @@ default config for android apk builds: &android_defaults
4141
# CACHE CONFIG
4242
# ==============================
4343

44-
# brew
45-
save brew cache: &cache_save_brew
46-
name: Saving Brew cache
47-
paths:
48-
- /usr/local/Homebrew
49-
- ~/Library/Caches/Homebrew
50-
key: legacy-brew-cache-{{ arch }}
51-
52-
restore brew cache: &cache_restore_brew
53-
name: Restoring Brew cache
54-
keys:
55-
- legacy-brew-cache-{{ arch }}
56-
57-
save brew cache for android: &cache_save_brew_android
58-
name: Saving Brew cache for android
59-
paths:
60-
- /usr/local/Homebrew
61-
- ~/Library/Caches/Homebrew
62-
key: legacy-brew-cache-{{ arch }}-android
63-
64-
restore brew cache for android: &cache_restore_brew_android
65-
name: Restoring Brew cache for android
66-
keys:
67-
- legacy-brew-cache-{{ arch }}-android
68-
6944
# yarn
7045
save yarn cache: &cache_save_yarn
7146
name: Saving Yarn cache
@@ -141,37 +116,24 @@ jobs:
141116
<<: *macos_defaults
142117
steps:
143118
- *addWorkspace
144-
- restore-cache: *cache_restore_brew
145119
- run:
146-
name: Configure OSX Environment
120+
name: Configure macOS Environment
147121
command: |
148-
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null
149-
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
150-
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
122+
brew bundle --file=.circleci/Brewfile.ios --no-lock
151123
touch .watchmanconfig
152124
node -v
153-
- save-cache: *cache_save_brew
154125
- restore-cache: *cache_restore_yarn
155126
- run:
156127
name: Installing Yarn dependencies
157128
command: yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
158129
- save-cache: *cache_save_yarn
159-
- restore_cache:
160-
key: 1-gems-{{ checksum "example/ios/Gemfile.lock" }}
161-
- run:
162-
name: Install CocoaPods
163-
command: cd example/ios && bundle check || bundle install --path vendor/bundle
164-
- save_cache:
165-
key: 1-gems-{{ checksum "example/ios/Gemfile.lock" }}
166-
paths:
167-
- vendor/bundle
168130
- run:
169131
name: Install pod dependencies
170-
command: cd example/ios && bundle exec pod install
132+
working_directory: example/ios
133+
command: pod install
171134
- run:
172135
name: Build iOS app
173136
command: yarn build:e2e:ios
174-
175137
- run:
176138
name: Run e2e tests
177139
command: yarn test:e2e:ios
@@ -191,7 +153,8 @@ jobs:
191153
- restore-cache: *cache_restore_gradle_build
192154
- run:
193155
name: Downloading Gradle dependencies
194-
command: cd example/android && ./gradlew --max-workers 2 fetchDependencies
156+
working_directory: example/android
157+
command: ./gradlew --max-workers 2 fetchDependencies
195158
- save-cache: *cache_save_gradle_wrapper
196159
- save-cache: *cache_save_gradle_build
197160

@@ -201,7 +164,8 @@ jobs:
201164
command: mkdir example/android/app/src/main/assets && npx react-native bundle --platform android --dev false --entry-file example/index.js --bundle-output example/android/app/src/main/assets/index.android.bundle --assets-dest example/android/app/src/main/res/
202165
- run:
203166
name: Build Android apk
204-
command: cd example/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2 -x bundleReleaseJsAndAssets
167+
working_directory: example/android
168+
command: ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2 -x bundleReleaseJsAndAssets
205169

206170
- persist_to_workspace:
207171
root: ~/async_storage
@@ -223,25 +187,20 @@ jobs:
223187
source $BASH_ENV
224188
225189
# Android tools
226-
- restore-cache: *cache_restore_brew_android
227190
- run:
228191
name: Install Android SDK tools
229192
command: |
230-
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null
231-
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk >/dev/null
232-
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install intel-haxm >/dev/null
233-
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null >/dev/null
234-
- save-cache: *cache_save_brew_android
193+
brew bundle --file=.circleci/Brewfile.android --no-lock
235194
236195
- run:
237196
name: Install Android emulator
238197
shell: /bin/bash -e
239198
command: |
240-
yes | sdkmanager "platform-tools" "tools" >/dev/null
241-
yes | sdkmanager "platforms;android-28" "system-images;android-21;google_apis;x86" >/dev/null
242-
yes | sdkmanager "emulator" --channel=3 >/dev/null
243-
yes | sdkmanager "build-tools;28.0.3" >/dev/null
244-
yes | sdkmanager --licenses >/dev/null
199+
yes | sdkmanager "platform-tools" "tools" 1> /dev/null
200+
yes | sdkmanager "platforms;android-28" "system-images;android-21;google_apis;x86" 1> /dev/null
201+
yes | sdkmanager "emulator" --channel=3 1> /dev/null
202+
yes | sdkmanager "build-tools;28.0.3" 1> /dev/null
203+
yes | sdkmanager --licenses 1> /dev/null
245204
yes | sdkmanager --list
246205
247206
- run:

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@
6868
"@react-native-community/cli-platform-android": "^3.1.0",
6969
"@react-native-community/cli-platform-ios": "^3.1.0",
7070
"@react-native-community/eslint-config": "^0.0.5",
71-
"babel-jest": "^24.9.0",
71+
"babel-jest": "^26.5.2",
7272
"babel-plugin-module-resolver": "3.1.3",
73-
"detox": "12.6.1",
73+
"detox": "16.7.2",
7474
"eslint": "5.1.0",
7575
"expo": "36.0.2",
7676
"flow-bin": "0.105.2",
77-
"jest": "^24.9.0",
77+
"jest": "^26.5.3",
7878
"metro": "0.56.4",
7979
"metro-react-native-babel-preset": "^0.56.0",
8080
"react": "16.9.0",
@@ -97,9 +97,9 @@
9797
"configurations": {
9898
"ios": {
9999
"binaryPath": "example/ios/build/Build/Products/Release-iphonesimulator/AsyncStorageExample.app",
100-
"build": ".circleci/scripts/run_ios_e2e.sh \"iPhone X\"",
100+
"build": ".circleci/scripts/run_ios_e2e.sh \"iPhone 11\"",
101101
"type": "ios.simulator",
102-
"name": "iPhone X"
102+
"name": "iPhone 11"
103103
},
104104
"android": {
105105
"binaryPath": "example/android/app/build/outputs/apk/release/app-release.apk",

0 commit comments

Comments
 (0)