From d75d86b5de6b1b4fed673f67d2b3a56915a388ac Mon Sep 17 00:00:00 2001 From: Rajdeep Nanua Date: Mon, 11 Sep 2023 17:47:38 -0400 Subject: [PATCH] Install android sdk for macos runners --- .circleci/config.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2ce8277..fffee06d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,28 +11,48 @@ executors: xcode: 14.3.1 resource_class: macos.m1.medium.gen1 +commands: + install_android_sdk: + description: "Install Android SDK in macOS machine" + steps: + - run: brew install wget + - run: wget --quiet --output-document="$HOME/android-commandline.zip" https://dl.google.com/android/repository/commandlinetools-mac-10406996_latest.zip + - run: set +o pipefail + - run: unzip "$HOME/android-commandline.zip" -d "$HOME" + - run: mkdir "$HOME/android-sdk" + - run: echo y | $HOME/cmdline-tools/bin/sdkmanager --sdk_root="$HOME/android-sdk" "platforms;android-33" > /dev/null + - run: echo y | $HOME/cmdline-tools/bin/sdkmanager --sdk_root="$HOME/android-sdk" "platform-tools" > /dev/null + - run: echo y | $HOME/cmdline-tools/bin/sdkmanager --sdk_root="$HOME/android-sdk" "build-tools;33.0.2" > /dev/null + - run: (yes || true) | $HOME/cmdline-tools/bin/sdkmanager --sdk_root="$HOME/android-sdk" --licenses + - run: set -o pipefail + jobs: setup: + environment: + ANDROID_HOME: "$HOME/android-sdk" executor: apple-ci-arm-medium steps: - checkout - node/install: install-yarn: true node-version: 'latest' + - install_android_sdk - run: yarn install --frozen-lockfile - run: yarn build - run: gem install cocoapods - - run: (cd ios; pod install) + - run: (cd e2e; yarn install --frozen-lockfile) - run: (cd android; ./gradlew assembleDebug) - - run: (cd e2e; yarn install --frozen-lockfile; yarn build) - - run: (cd e2e/ios; pod install) - run: (cd e2e/android; echo "signInRedirectUri=com.example.redirect:/login" > okta.properties; ./gradlew assembleDebug) + - run: (cd ios; pod install) + - run: (cd e2e/ios; pod install) - persist_to_workspace: root: ~/project paths: - . snyk-scan: + environment: + ANDROID_HOME: "$HOME/android-sdk" executor: apple-ci-arm-medium steps: - attach_workspace: @@ -40,6 +60,7 @@ jobs: - run: name: Install rosetta # Needed for snyk to work on M1 machines. command: softwareupdate --install-rosetta --agree-to-license + - install_android_sdk - general-platform-helpers/step-load-dependencies - general-platform-helpers/step-run-snyk-monitor: run-on-non-main: true