From ff64e77bcd263cc0d80ac41d596885a8ccf52908 Mon Sep 17 00:00:00 2001 From: Butta Date: Sat, 21 Aug 2021 22:26:49 +0530 Subject: [PATCH] Cache NDK 23 --- .github/workflows/packages.yml | 13 ++++++++++++- scripts/setup-android-sdk.sh | 11 ++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index c1b8337ff3855db..e1cc91e5f2495ef 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -18,9 +18,19 @@ jobs: NDK: "/opt/termux/android-ndk" strategy: matrix: - target_arch: [aarch64, arm, i686, x86_64] + target_arch: [aarch64]#, arm, i686, x86_64] fail-fast: false steps: + - name: Get cached NDK 23 + id: cache-ndk + uses: actions/cache@v2 + with: + path: ~/android-ndk-r23-linux.zip + key: android-ndk-r23 + - name: Get latest NDK if not cached + if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }} + run: | + wget -q -O ~/android-ndk-r23-linux.zip https://dl.google.com/android/repository/android-ndk-r23-linux.zip - name: Clone repository uses: actions/checkout@v2 with: @@ -117,6 +127,7 @@ jobs: fi if [ -f ./built_packages.txt ]; then + cp ~/android-ndk-r23-linux.zip ./scripts ./scripts/run-docker.sh ./scripts/setup-android-sdk.sh ./scripts/lint-packages.sh $(cat ./built_packages.txt | awk '{print "packages/"$1"/build.sh"}') diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index 769780e153d03d7..e27d1b1646fd7d9 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -27,17 +27,14 @@ fi more $NDK/source.properties rm -rf $NDK +ANDROID_NDK_ZIP=`pwd`/scripts/$ANDROID_NDK_FILE if [ ! -d $NDK ]; then mkdir -p $NDK cd $NDK/.. rm -Rf $(basename $NDK) - echo "Downloading android ndk..." - curl --fail --retry 3 -o ndk.zip \ - https://dl.google.com/android/repository/${ANDROID_NDK_FILE} - echo "${ANDROID_NDK_SHA256} ndk.zip" | sha256sum -c - - rm -Rf android-ndk-r$TERMUX_NDK_VERSION - unzip -q ndk.zip + echo "${ANDROID_NDK_SHA256} ${ANDROID_NDK_ZIP}" | sha256sum -c - + unzip -q $ANDROID_NDK_ZIP mv android-ndk-r$TERMUX_NDK_VERSION $(basename $NDK) - rm ndk.zip + rm $ANDROID_NDK_ZIP more $NDK/source.properties fi