Apply latest env variables in github host runner to fix CI (#1334)

Currently we are using `ANDROID_HOME` and `ANDROID_NDK_LATEST_HOME`.
All variables should follow definitions in https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3
This commit is contained in:
liang.he 2022-07-27 14:11:51 +08:00 committed by GitHub
parent 8de5168cea
commit ab752cd5c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -527,13 +527,13 @@ able to generate a shared library support Android platform.
- look for a command named *sdkmanager* and download below components. version numbers might need to check and pick others - look for a command named *sdkmanager* and download below components. version numbers might need to check and pick others
- "build-tools;29.0.3" - "build-tools;29.0.3"
- "cmake;3.10.2.4988404" - "cmake;3.10.2.4988404"
- "ndk;21.0.6113669" - "ndk;latest"
- "patcher;v4" - "patcher;v4"
- "platform-tools" - "platform-tools"
- "platforms;android-29" - "platforms;android-29"
- add bin/ of the downloaded cmake to $PATH - add bin/ of the downloaded cmake to $PATH
- export ANDROID_SDK_HOME=/the/path/of/downloaded/sdk/ - export ANDROID_HOME=/the/path/of/downloaded/sdk/
- export ANDROID_NDK_HOME=/the/path/of/downloaded/sdk/ndk/ - export ANDROID_NDK_LATEST_HOME=/the/path/of/downloaded/sdk/ndk/2x.xxx/
- ready to go - ready to go
Use such commands, you are able to compile with default configurations. Any compiling requirement should be satisfied by modifying product-mini/platforms/android/CMakeList.txt. For example, chaning ${WAMR_BUILD_TARGET} in CMakeList could get different libraries support different ABIs. Use such commands, you are able to compile with default configurations. Any compiling requirement should be satisfied by modifying product-mini/platforms/android/CMakeList.txt. For example, chaning ${WAMR_BUILD_TARGET} in CMakeList could get different libraries support different ABIs.

View File

@ -6,9 +6,11 @@ cmake_minimum_required (VERSION 3.4.1)
set (CMAKE_VERBOSE_MAKEFILE on) set (CMAKE_VERBOSE_MAKEFILE on)
set (CMAKE_BUILD_TYPE Release) set (CMAKE_BUILD_TYPE Release)
set (CMAKE_TOOLCHAIN_FILE "$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3
set (ANDROID_NDK $ENV{ANDROID_NDK_HOME}) set (CMAKE_TOOLCHAIN_FILE "$ENV{ANDROID_NDK_LATEST_HOME}/build/cmake/android.toolchain.cmake")
set (ANDROID_SDK $ENV{ANDROID_SDK_HOME}) set (ANDROID_SDK $ENV{ANDROID_HOME})
set (ANDROID_NDK $ENV{ANDROID_NDK_LATEST_HOME})
set (ANDROID_ABI "x86") set (ANDROID_ABI "x86")
set (ANDROID_LD lld) set (ANDROID_LD lld)
if (NOT DEFINED ANDROID_PLATFORM) if (NOT DEFINED ANDROID_PLATFORM)