From 3ad5ace351fc298a2f743dc3dd85e11fb1101751 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:32:22 +0200 Subject: ci: Revamp Android SDK cache, and update it timely --- .cirrus.yml | 8 +++----- ci/test/05_before_script.sh | 9 +++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index c328f442eb..c3cc776926 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -51,10 +51,6 @@ global_task_template: &GLOBAL_TASK_TEMPLATE << : *BASE_TEMPLATE << : *MAIN_TEMPLATE -depends_sdk_cache_template: &DEPENDS_SDK_CACHE_TEMPLATE - depends_sdk_cache: - folder: "depends/sdk-sources" - compute_credits_template: &CREDITS_TEMPLATE # https://cirrus-ci.org/pricing/#compute-credits # Only use credits for pull requests to the main repo @@ -300,8 +296,10 @@ task: task: name: 'ARM64 Android APK [focal]' - << : *DEPENDS_SDK_CACHE_TEMPLATE << : *BASE_TEMPLATE + android_sdk_cache: + folder: "depends/SDKs/android" + fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=22.1.7171670" depends_sources_cache: folder: "depends/sources" fingerprint_script: git rev-list -1 HEAD ./depends diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index 4a54ce7eb8..d8c23bd26b 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -26,10 +26,11 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ] DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi -if [ -n "$ANDROID_TOOLS_URL" ]; then - ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip - - DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH" +if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then + ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip + if [ ! -f "$ANDROID_TOOLS_PATH" ]; then + DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH" + fi DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools" DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools" DOCKER_EXEC "yes | ${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager --install \"build-tools;${ANDROID_BUILD_TOOLS_VERSION}\" \"platform-tools\" \"platforms;android-${ANDROID_API_LEVEL}\" \"ndk;${ANDROID_NDK_VERSION}\"" -- cgit v1.2.3