diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc975b4b8..315f3a25b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/bin/android-functions.sh b/bin/android-functions.sh index 93a0f7ee6..e528622a0 100755 --- a/bin/android-functions.sh +++ b/bin/android-functions.sh @@ -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") @@ -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 @@ -783,12 +787,15 @@ 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)" write_log "v" "# Running Android licensing process" - write_log "d" "$yes | $(native_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER")" --licenses - $yes | "$(native_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER")" --licenses + write_log "d" "$yes 2>/dev/null | $(native_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER")" --licenses + eval "$yes 2>/dev/null | $(native_path "$ANDROID_HOME/$ANDROID_SDK_MANAGER") --licenses" + # echo -n + echo "yes ec: $?" # mask exit code, broken pipe causes failure on macos fi JAVA_OPTS="$OLD_JAVA_OPTS"