Skip to content

ci(iOS): Fix yarn install failing with Xcode 12 #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/Brewfile.android
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tap 'homebrew/cask'
cask 'android-sdk'
cask 'intel-haxm'
3 changes: 3 additions & 0 deletions .circleci/Brewfile.ios
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tap 'wix/brew'
brew 'applesimutils'
brew 'cocoapods'
52 changes: 20 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ checkout step for each job: &addWorkspace
default config for js: &js_defaults
<<: *defaults
docker:
- image: circleci/node:10
- image: circleci/node:12

default config for macOS: &macos_defaults
<<: *defaults
resource_class: 'medium'
macos:
xcode: '10.1.0'
xcode: '11.7.0'

default config for android apk builds: &android_defaults
<<: *defaults
Expand All @@ -47,24 +47,24 @@ save brew cache: &cache_save_brew
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
key: legacy-brew-cache-{{ arch }}
key: legacy-brew-cache-node12-{{ arch }}

restore brew cache: &cache_restore_brew
name: Restoring Brew cache
keys:
- legacy-brew-cache-{{ arch }}
- legacy-brew-cache-node12-{{ arch }}

save brew cache for android: &cache_save_brew_android
name: Saving Brew cache for android
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
key: legacy-brew-cache-{{ arch }}-android
key: legacy-brew-cache-node12-{{ arch }}-android

restore brew cache for android: &cache_restore_brew_android
name: Restoring Brew cache for android
keys:
- legacy-brew-cache-{{ arch }}-android
- legacy-brew-cache-node12-{{ arch }}-android

# yarn
save yarn cache: &cache_save_yarn
Expand Down Expand Up @@ -143,11 +143,9 @@ jobs:
- *addWorkspace
- restore-cache: *cache_restore_brew
- run:
name: Configure OSX Environment
name: Configure macOS Environment
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
brew bundle --file=.circleci/Brewfile.ios --no-lock
touch .watchmanconfig
node -v
- save-cache: *cache_save_brew
Expand All @@ -156,22 +154,13 @@ jobs:
name: Installing Yarn dependencies
command: yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
- save-cache: *cache_save_yarn
- restore_cache:
key: 1-gems-{{ checksum "example/ios/Gemfile.lock" }}
- run:
name: Install CocoaPods
command: cd example/ios && bundle check || bundle install --path vendor/bundle
- save_cache:
key: 1-gems-{{ checksum "example/ios/Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Install pod dependencies
command: cd example/ios && bundle exec pod install
working_directory: example/ios
command: pod install
- run:
name: Build iOS app
command: yarn build:e2e:ios

- run:
name: Run e2e tests
command: yarn test:e2e:ios
Expand All @@ -191,7 +180,8 @@ jobs:
- restore-cache: *cache_restore_gradle_build
- run:
name: Downloading Gradle dependencies
command: cd example/android && ./gradlew --max-workers 2 fetchDependencies
working_directory: example/android
command: ./gradlew --max-workers 2 fetchDependencies
- save-cache: *cache_save_gradle_wrapper
- save-cache: *cache_save_gradle_build

Expand All @@ -201,7 +191,8 @@ jobs:
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/
- run:
name: Build Android apk
command: cd example/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2 -x bundleReleaseJsAndAssets
working_directory: example/android
command: ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2 -x bundleReleaseJsAndAssets

- persist_to_workspace:
root: ~/async_storage
Expand All @@ -227,21 +218,18 @@ jobs:
- run:
name: Install Android SDK tools
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install intel-haxm >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null >/dev/null
brew bundle --file=.circleci/Brewfile.android --no-lock
- save-cache: *cache_save_brew_android

- run:
name: Install Android emulator
shell: /bin/bash -e
command: |
yes | sdkmanager "platform-tools" "tools" >/dev/null
yes | sdkmanager "platforms;android-28" "system-images;android-21;google_apis;x86" >/dev/null
yes | sdkmanager "emulator" --channel=3 >/dev/null
yes | sdkmanager "build-tools;28.0.3" >/dev/null
yes | sdkmanager --licenses >/dev/null
yes | sdkmanager "platform-tools" "tools" 1> /dev/null
yes | sdkmanager "platforms;android-28" "system-images;android-21;google_apis;x86" 1> /dev/null
yes | sdkmanager "emulator" --channel=3 1> /dev/null
yes | sdkmanager "build-tools;28.0.3" 1> /dev/null
yes | sdkmanager --licenses 1> /dev/null
yes | sdkmanager --list

- run:
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
"@react-native-community/cli-platform-android": "^3.1.0",
"@react-native-community/cli-platform-ios": "^3.1.0",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"babel-jest": "^26.5.2",
"babel-plugin-module-resolver": "3.1.3",
"detox": "12.6.1",
"detox": "16.7.2",
"eslint": "5.1.0",
"expo": "36.0.2",
"flow-bin": "0.105.2",
"jest": "^24.9.0",
"jest": "^26.5.3",
"metro": "0.56.4",
"metro-react-native-babel-preset": "^0.56.0",
"react": "16.9.0",
Expand All @@ -97,9 +97,9 @@
"configurations": {
"ios": {
"binaryPath": "example/ios/build/Build/Products/Release-iphonesimulator/AsyncStorageExample.app",
"build": ".circleci/scripts/run_ios_e2e.sh \"iPhone X\"",
"build": ".circleci/scripts/run_ios_e2e.sh \"iPhone 11\"",
"type": "ios.simulator",
"name": "iPhone X"
"name": "iPhone 11"
},
"android": {
"binaryPath": "example/android/app/build/outputs/apk/release/app-release.apk",
Expand Down
Loading