unified android ci #4
Workflow file for this run
This file contains 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: android | |
on: | |
push: | |
branches: [master] | |
paths: | |
- '.github/workflows/android.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'src/*' | |
- 'src/layer/*' | |
- 'src/layer/arm/**' | |
- 'src/layer/x86/**' | |
- 'src/layer/mips/**' | |
- 'src/layer/vulkan/**' | |
pull_request: | |
branches: [master] | |
paths: | |
- '.github/workflows/android.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'src/*' | |
- 'src/layer/*' | |
- 'src/layer/arm/**' | |
- 'src/layer/x86/**' | |
- 'src/layer/mips/**' | |
- 'src/layer/vulkan/**' | |
concurrency: | |
group: android-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
NCNN_CMAKE_OPTIONS: | | |
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake \ | |
-DANDROID_PLATFORM=android-21 \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DNCNN_VULKAN=ON \ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: armeabi-v7a | |
run: | | |
mkdir build-armeabi-v7a && cd build-armeabi-v7a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON .. | |
cmake --build . -j $(nproc) | |
- name: arm64-v8a | |
run: | | |
mkdir build-arm64-v8a && cd build-arm64-v8a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="arm64-v8a" .. | |
cmake --build . -j $(nproc) | |
- name: x86 | |
run: | | |
mkdir build-x86 && cd build-x86 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="x86" .. | |
cmake --build . -j $(nproc) | |
- name: x86_64 | |
run: | | |
mkdir build-x86_64 && cd build-x86_64 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="x86_64" .. | |
cmake --build . -j $(nproc) | |
- name: armeabi-v7a-shared | |
run: | | |
mkdir build-armeabi-v7a && cd build-armeabi-v7a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
- name: arm64-v8a-shared | |
run: | | |
mkdir build-arm64-v8a && cd build-arm64-v8a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="arm64-v8a" -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
- name: x86-shared | |
run: | | |
mkdir build-x86 && cd build-x86 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="x86" -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
- name: x86_64-shared | |
run: | | |
mkdir build-x86_64 && cd build-x86_64 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="x86_64" -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
ndk-r16b: | |
runs-on: ubuntu-latest | |
container: ubuntu:20.04 | |
env: | |
NCNN_CMAKE_OPTIONS: | | |
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake \ | |
-DANDROID_PLATFORM=android-21 \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DNCNN_VULKAN=ON \ | |
steps: | |
- name: install-deps | |
run: | | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y cmake wget git curl | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: ndk-r16b | |
run: | | |
wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip -O $GITHUB_WORKSPACE/android-ndk-r16b-linux-x86_64.zip | |
cd $GITHUB_WORKSPACE && unzip -q android-ndk-r16b-linux-x86_64.zip | |
- name: armeabi-v7a | |
run: | | |
mkdir build-armeabi-v7a && cd build-armeabi-v7a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF .. | |
cmake --build . -j $(nproc) | |
- name: mips | |
run: | | |
mkdir build-mips && cd build-mips | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="mips" .. | |
cmake --build . -j $(nproc) | |
- name: mips64 | |
run: | | |
mkdir build-mips64 && cd build-mips64 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="mips64" .. | |
cmake --build . -j $(nproc) | |
- name: armeabi-v7a-shared | |
run: | | |
mkdir build-armeabi-v7a && cd build-armeabi-v7a | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
- name: mips-shared | |
run: | | |
mkdir build-mips && cd build-mips | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="mips" -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) | |
- name: mips64-shared | |
run: | | |
mkdir build-mips64 && cd build-mips64 | |
cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DANDROID_ABI="mips64" -DNCNN_SHARED_LIB=ON .. | |
cmake --build . -j $(nproc) |