Skip to content

Commit

Permalink
Install android sdk for macos runners
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepnanua-okta committed Sep 11, 2023
1 parent 3cb8823 commit 86681b4
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ executors:
xcode: 14.3.1
resource_class: macos.m1.medium.gen1

commands:
installAndroidSdk:
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 --sdkroot="$HOME/android-sdk" "platforms;android-33" > /dev/null
- run: echo y | $HOME/cmdline-tools/bin/sdkmanager --sdkroot="$HOME/android-sdk" "platform-tools" > /dev/null
- run: echo y | $HOME/cmdline-tools/bin/sdkmanager --sdkroot="$HOME/android-sdk" "build-tools;33.0.2" > /dev/null
- run: yes | $HOME/cmdline-tools/bin/sdkmanager --sdkroot="$HOME/android-sdk" --licenses
- run: export ANDROID_HOME=$HOME/android-sdk
- run: set -o pipefail

jobs:
setup:
executor: apple-ci-arm-medium
Expand All @@ -23,9 +39,10 @@ jobs:
- run: yarn build
- run: gem install cocoapods
- run: (cd ios; pod install)
- run: (cd android; ./gradlew assembleDebug)
- run: (cd e2e; yarn install --frozen-lockfile; yarn build)
- run: (cd e2e; yarn install --frozen-lockfile)
- run: (cd e2e/ios; pod install)
- installAndroidSdk
- run: (cd android; ./gradlew assembleDebug)
- run: (cd e2e/android; echo "signInRedirectUri=com.example.redirect:/login" > okta.properties; ./gradlew assembleDebug)
- persist_to_workspace:
root: ~/project
Expand All @@ -40,6 +57,7 @@ jobs:
- run:
name: Install rosetta # Needed for snyk to work on M1 machines.
command: softwareupdate --install-rosetta --agree-to-license
- installAndroidSdk
- general-platform-helpers/step-load-dependencies
- general-platform-helpers/step-run-snyk-monitor:
run-on-non-main: true
Expand Down

0 comments on commit 86681b4

Please sign in to comment.