echodict/llama.cpp
version https://git-lfs.github.com/spec/v1 oid sha256:cfc44b7ba25614df70e6b65e3341cae0310163bd32fd31a6b928a542df433faf size 30786
0773
1name: CI (android)2 3on:4 workflow_dispatch: # allows manual triggering5 push:6 branches:7 - master8 paths: [9 '.github/workflows/build-android.yml',10 '**/CMakeLists.txt',11 '**/.cmake',12 '**/*.h',13 '**/*.hpp',14 '**/*.c',15 '**/*.cpp'16 ]17 18 pull_request:19 types: [opened, synchronize, reopened]20 paths: [21 '.github/workflows/build-android.yml',22 'examples/llama.android/**'23 ]24 25concurrency:26 group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}27 cancel-in-progress: true28 29env:30 GGML_NLOOP: 331 GGML_N_THREADS: 132 LLAMA_LOG_COLORS: 133 LLAMA_LOG_PREFIX: 134 LLAMA_LOG_TIMESTAMPS: 135 36jobs:37 android:38 runs-on: ubuntu-latest39 40 steps:41 - name: Clone42 uses: actions/checkout@v643 with:44 fetch-depth: 045 lfs: false46 47 - name: Set up JDK48 uses: actions/setup-java@v549 with:50 java-version: 1751 distribution: zulu52 53 - name: Setup Android SDK54 uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.155 with:56 log-accepted-android-sdk-licenses: false57 58 - name: Build59 run: |60 cd examples/llama.android61 ./gradlew build --no-daemon62 63 android-ndk:64 runs-on: ubuntu-latest65 container:66 image: 'ghcr.io/snapdragon-toolchain/arm64-android:v0.3'67 defaults:68 run:69 shell: bash70 strategy:71 matrix:72 include:73 - build: 'arm64-cpu'74 defines: '-D ANDROID_ABI=arm64-v8a -D ANDROID_PLATFORM=android-31 -D CMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -D GGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8.5-a+fp16+i8mm -G Ninja -D LLAMA_OPENSSL=OFF -D GGML_OPENMP=OFF'75 - build: 'arm64-snapdragon'76 defines: '--preset arm64-android-snapdragon-release'77 78 steps:79 - name: Clone80 id: checkout81 uses: actions/checkout@v682 with:83 fetch-depth: 084 lfs: false85 86 - name: Build Llama.CPP for Hexagon Android87 id: build_llama_cpp_hexagon_android88 run: |89 if [[ "${{ matrix.build }}" == "arm64-snapdragon" ]]; then90 cp docs/backend/snapdragon/CMakeUserPresets.json .91 fi92 cmake ${{ matrix.defines }} -B build93 cmake --build build94 cmake --install build --prefix pkg-adb/llama.cpp95 96 - name: Upload Llama.CPP Hexagon Android Build Artifact97 if: ${{ always() && steps.build_llama_cpp_hexagon_android.outcome == 'success' }}98 uses: actions/upload-artifact@v699 with:100 name: llama-cpp-android-${{ matrix.build }}101 path: pkg-adb/llama.cpp102 