fix: 尝试修复 NDK 缓存功能(AI)

This commit is contained in:
Super12138 2026-02-14 23:27:01 +08:00 committed by GitHub
parent 8b1ec55ff9
commit 71abf6435f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,8 @@
name: Android CI name: Android CI
env:
NDK_VERSION: "28.2.13676358"
on: on:
push: push:
branches: [ "main" ] branches: [ "main" ]
@ -24,20 +28,16 @@ jobs:
distribution: 'temurin' distribution: 'temurin'
cache: gradle cache: gradle
# 缓存NDK
- name: Cache NDK - name: Cache NDK
id: cache-ndk
uses: actions/cache@v5.0.3 uses: actions/cache@v5.0.3
with: with:
path: | path: ${{ env.ANDROID_HOME }}/ndk/${{ env.NDK_VERSION }}
${{ env.ANDROID_HOME }}/ndk key: ${{ runner.os }}-ndk-${{ env.NDK_VERSION }}
key: ndk-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
ndk-${{ runner.os }}-
# 仅当NDK缓存未命中时才安装NDK - name: Install NDK
- name: Install NDK 28.2.13676358
if: steps.cache-ndk.outputs.cache-hit != 'true' if: steps.cache-ndk.outputs.cache-hit != 'true'
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install 'ndk;28.2.13676358' run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
- name: Grant execute permission for gradlew - name: Grant execute permission for gradlew
run: chmod +x gradlew run: chmod +x gradlew