Skip to content

Commit

Permalink
macos android ci(perf): don't use built in java
Browse files Browse the repository at this point in the history
  • Loading branch information
mribbons committed Apr 18, 2023
1 parent 4a7f8ea commit d1b55c4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,37 @@ jobs:
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Android FTE - test jh
run: |
./bin/android-functions.sh --android-fte --yes-deps --test-jh
env:
VERBOSE: 1
NO_IOS: 1
CI: true
SSC_ANDROID_CI: true
ANDROID_SUPPORTED_ABIS: x86_64
JAVA_HOME: ""
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PAT }}

- name: Android FTE
run: |
./bin/android-functions.sh --android-fte --yes-deps
env:
VERBOSE: 1
DEBUG: 1
NO_IOS: 1
CI: true
SSC_ANDROID_CI: true
ANDROID_SUPPORTED_ABIS: x86_64
JAVA_HOME: ""
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PAT }}

- name: install Socket Runtime deps
run: |
brew install automake
- name: Build Socket Runtime
run: |
./bin/android-functions.sh --android-fte --yes-deps
./bin/install.sh
./bin/ci_version_check.sh
env:
Expand Down
7 changes: 6 additions & 1 deletion bin/android-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function get_android_default_search_paths() {
JAVA_HOME_SEARCH_PATHS+=("$HOME/.local/bin")
JAVA_HOME_SEARCH_PATHS+=("$HOME/Applications")
JAVA_HOME_SEARCH_PATHS+=("$HOME/homebrew")
JAVA_HOME_SEARCH_PATHS+=("/Applications")
[[ -z "$CI" ]] && JAVA_HOME_SEARCH_PATHS+=("/Applications")
elif [[ "$host" = "Linux" ]]; then
ANDROID_HOME_SEARCH_PATHS+=("$HOME")
JAVA_HOME_SEARCH_PATHS+=("$HOME/.local/bin")
Expand Down Expand Up @@ -749,11 +749,15 @@ function android_fte() {
local set_exit_code=""

[[ -n "$android_fte" ]] && return 0
[[ "$CI" == "true" ]] && export JAVA_HOME=""

echo "JAVA_HOME: $JAVA_HOME"

while (( $# > 0 )); do
declare arg="$1"; shift
[[ "$arg" == "--yes-deps" ]] && pass_yes_deps="$arg"
[[ "$arg" == "--exit-code" ]] && set_exit_code="1"
[[ "$arg" == "--test-jh" ]] && exit 0
done

android_fte=1
Expand Down Expand Up @@ -783,6 +787,7 @@ function android_fte() {

if [[ -n "$ANDROID_HOME" ]]; then
write_log "h" "# Ensuring Android dependencies are installed"
[[ -n "$CI" ]] && write_log "d" "# JAVA_HOME: $JAVA_HOME"
write_log "d" "$yes | $(unix_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER")" "$SDK_OPTIONS"
# Without eval, sdk manager says there is a syntax error
eval "$yes | ($(unix_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER") $SDK_OPTIONS)"
Expand Down

0 comments on commit d1b55c4

Please sign in to comment.