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 d75d86b
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,56 @@ 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:
at: ~/project
- 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
Expand Down

0 comments on commit d75d86b

Please sign in to comment.