test #607
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Build library | |
| on: | |
| push: | |
| jobs: | |
| android-build: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: android-arm64-vulkan | |
| ABI: arm64-v8a | |
| steps: | |
| - id: setup_libs_linux | |
| name: Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake zip libssl-dev git libcurl4-openssl-dev curl libgomp1 | |
| - id: checkout | |
| name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - id: ls | |
| name: List | |
| run: | | |
| find /usr/local/lib/android/sdk/ndk/27.3.13750724/toolchains -name libvulkan.so | |
| ls -R /usr/local/lib/android/sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/ | |
| - id: preparation | |
| name: Preparation | |
| run: | | |
| mkdir -p build/libs | |
| echo "CMAKE_VARS=-DARCHITECTURE=${{ matrix.arch }} -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${{ github.workspace }}/build/libs -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${{ github.workspace }}/build/libs -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${{ github.workspace }}/build/libs ${{ matrix.cmake_vars }}" >> $GITHUB_ENV | |
| shell: bash | |
| - id: setup_vulkan_linux | |
| if: contains(matrix.arch, 'vulkan') | |
| name: Dependencies Vulcan | |
| run: | | |
| wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
| sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list | |
| sudo apt-get update -y | |
| sudo apt-get install -y build-essential vulkan-sdk | |
| cp /lib/x86_64-linux-gnu/libvulkan.so.1 build/libs/ | |
| git submodule add https://github.com/KhronosGroup/Vulkan-Headers.git third_party/Vulkan-Headers | |
| cd third_party/Vulkan-Headers | |
| git checkout v1.3.275 | |
| - id: cpu-cores | |
| name: Get number of CPU cores | |
| uses: SimenB/github-actions-cpu-cores@v2 | |
| - id: build_openssl | |
| name: Build OpenSSL | |
| run: | | |
| .github/scripts/build_openssl.sh ${{ matrix.arch }} | |
| - id: cmake_build_android | |
| name: Build | |
| run: | | |
| export LD_LIBRARY_PATH="" | |
| export NDK=`ls -d /usr/local/lib/android/sdk/ndk/27.*` | |
| cd build | |
| cmake .. -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-29 -DANDROID_ABI=${{ matrix.ABI }} ${{ env.CMAKE_VARS }} | |
| cmake --build . --config Release -j ${{ steps.cpu-cores.outputs.count }} | |
| - id: pack_artifacts | |
| name: Pack artifacts | |
| run: | | |
| ls -R build | |
| mkdir -p artifacts | |
| mv build/Release/*llamalib* artifacts/ 2>/dev/null || true | |
| mv build/libs/*llamalib* artifacts/ 2>/dev/null || true | |
| mv build/libs/*.so* artifacts/ 2>/dev/null || true | |
| mv build/libs/Release/*llamalib* artifacts/ 2>/dev/null || true | |
| mv build/libs/Release/*.dll artifacts/ 2>/dev/null || true | |
| rm -f artifacts/*llamalib_tests* artifacts/*exp artifacts/*server*lib 2>/dev/null || true | |
| rm -r build | |
| cd artifacts | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| 7z a ../${{ matrix.arch }}.zip * | |
| else | |
| zip ../${{ matrix.arch }}.zip * | |
| fi | |
| shell: bash | |
| - id: upload_llamalib | |
| name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.arch }}.zip | |
| path: ${{ matrix.arch }}.zip |