Bladeren bron

Improve android ci (#7413)

* Improve android ci

* Fix NDK installation script and update test commands for Android CI

* Add missing `-y` flag to xrepo commands in Android CI workflows

* Improve NDK version check logic to handle optional version requirement

* Comment out unused on_fetch function in NDK package

* Update NDK version 27.0 hash and add c-ares version 1.34.5

* Add cleanup step to remove local NDK before build

* Add local repository to tests in Android CI workflows

* Remove local repository addition from Android CI test steps

* Update Android CI workflows to set NDK version based on matrix configuration

* Rename local Android directory to avoid conflicts during CI workflow

* Update Android CI workflows to set ANDROID_NDK_ROOT environment variable for tests

* Update NDK version handling in Android CI workflows for consistent testing

* set ANDROID_NDK_HOME environment null

* remove redundant NDK cleanup steps from Android CI workflows
star9029 6 maanden geleden
bovenliggende
commit
a7cf51932f
3 gewijzigde bestanden met toevoegingen van 13 en 20 verwijderingen
  1. 6 9
      .github/workflows/android.yml
  2. 6 11
      .github/workflows/android_windows.yml
  3. 1 0
      packages/c/c-ares/xmake.lua

+ 6 - 9
.github/workflows/android.yml

@@ -28,16 +28,13 @@ jobs:
           actions-cache-folder: ".xmake-cache"
           actions-cache-key: "android"
 
-      - name: Prepare
+      - name: Tests
+        env:
+          ANDROID_NDK_ROOT: ""
+          ANDROID_NDK_HOME: ""
         run: |
           if test ${{ matrix.ndk }} = "r27"; then
-            wget -q https://dl.google.com/android/repository/android-ndk-r27-linux.zip
-            unzip -q -o ./android-ndk-r27-linux.zip
+            xrepo env -y -b "ndk 27.0" xmake l ./scripts/test.lua -D -p android -a ${{ matrix.arch }} --ndk_sdkver=${{ matrix.ndk_sdkver }} 
           else
-            wget -q https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip
-            unzip -q -o ./android-ndk-r22-linux-x86_64.zip
+            xrepo env -y -b "ndk 22.0" xmake l ./scripts/test.lua -D -p android -a ${{ matrix.arch }} --ndk_sdkver=${{ matrix.ndk_sdkver }} 
           fi
-
-      - name: Tests
-        run: |
-          xmake l ./scripts/test.lua -D -p android --ndk=`pwd`/android-ndk-${{ matrix.ndk }} --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }}

+ 6 - 11
.github/workflows/android_windows.yml

@@ -33,18 +33,13 @@ jobs:
           maximum-size: 32GB
           disk-root: "C:"
 
-      - name: Prepare
+      - name: Tests
+        env:
+          ANDROID_NDK_ROOT: ""
+          ANDROID_NDK_HOME: ""
         run: |
           if ("${{ matrix.ndk }}" -eq "r27") {
-            curl -fsSL "https://dl.google.com/android/repository/android-ndk-r27-windows.zip" -o android-ndk-r27-windows.zip
-            Expand-Archive ./android-ndk-r27-windows.zip -DestinationPath ./ndk
+            xrepo env -y -b "ndk 27.0" xmake l ./scripts/test.lua -D -p android -a ${{ matrix.arch }} --ndk_sdkver=${{ matrix.ndk_sdkver }} 
           } else {
-            curl -fsSL "https://dl.google.com/android/repository/android-ndk-r22-windows-x86_64.zip" -o android-ndk-r22-windows-x86_64.zip
-            Expand-Archive ./android-ndk-r22-windows-x86_64.zip -DestinationPath ./ndk
+            xrepo env -y -b "ndk 22.0" xmake l ./scripts/test.lua -D -p android -a ${{ matrix.arch }} --ndk_sdkver=${{ matrix.ndk_sdkver }} 
           }
-
-      - name: Tests
-        run: |
-          $Env:XMAKE_MAIN_REPO = "https://github.com/xmake-io/xmake-repo.git"
-          xmake --version
-          xmake l ./scripts/test.lua -D -p android --ndk=C:/a/xmake-repo/xmake-repo/ndk/android-ndk-${{ matrix.ndk }} --ndk_sdkver=${{ matrix.ndk_sdkver }} -a ${{ matrix.arch }}

+ 1 - 0
packages/c/c-ares/xmake.lua

@@ -11,6 +11,7 @@ package("c-ares")
         end
     end})
 
+    add_versions("1.34.5", "7d935790e9af081c25c495fd13c2cfcda4792983418e96358ef6e7320ee06346")
     add_versions("1.34.4", "fa38dbed659ee4cc5a32df5e27deda575fa6852c79a72ba1af85de35a6ae222f")
     add_versions("1.34.3", "26e1f7771da23e42a18fdf1e58912a396629e53a2ac71b130af93bbcfb90adbe")
     add_versions("1.34.1", "7e846f1742ab5998aced36d170408557de5292b92ec404fb0f7422f946d60103")