2023-05-16 06:55:57 +08:00
|
|
|
name: build
|
|
|
|
|
2023-05-16 06:56:57 +08:00
|
|
|
on: [push, pull_request]
|
2023-05-16 06:55:57 +08:00
|
|
|
|
2023-05-16 07:12:03 +08:00
|
|
|
env:
|
|
|
|
NDK_VERSION: 25.2.9519653
|
2023-05-16 07:57:13 +08:00
|
|
|
MIN_SDK_VERSION: 21
|
2023-05-16 07:12:03 +08:00
|
|
|
|
2023-05-16 06:55:57 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-05-16 07:57:13 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
abi: ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
|
|
|
|
|
2023-05-16 06:55:57 +08:00
|
|
|
steps:
|
2023-05-16 07:07:49 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-05-16 06:55:57 +08:00
|
|
|
|
2023-05-16 07:12:03 +08:00
|
|
|
- name: Cache NDK
|
|
|
|
id: ndk-cache
|
2023-05-16 07:59:23 +08:00
|
|
|
uses: actions/cache@v3
|
2023-05-16 07:12:03 +08:00
|
|
|
with:
|
|
|
|
path: ndk
|
|
|
|
key: ndk-${{ env.NDK_VERSION }}
|
|
|
|
restore-keys: |
|
|
|
|
ndk-${{ env.NDK_VERSION }}
|
|
|
|
|
2023-05-16 06:55:57 +08:00
|
|
|
- name: Install NDK
|
2023-05-16 07:12:03 +08:00
|
|
|
if: steps.ndk-cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
|
|
|
|
mv $ANDROID_HOME/ndk/${{ env.NDK_VERSION }} ndk
|
|
|
|
|
|
|
|
- name: Set NDK environment variable
|
|
|
|
run: echo "ANDROID_NDK_HOME=$(pwd)/ndk" >> $GITHUB_ENV
|
2023-05-16 06:55:57 +08:00
|
|
|
|
2023-05-16 07:57:13 +08:00
|
|
|
- name: Build with CMake
|
2023-05-16 06:55:57 +08:00
|
|
|
run: |
|
2023-05-16 07:58:33 +08:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -DANDROID_PLATFORM=android-${{ env.MIN_SDK_VERSION }} -DANDROID_ARM_NEON=TRUE .
|
2023-05-16 06:55:57 +08:00
|
|
|
cmake --build . -- -j$(nproc)
|
|
|
|
|
2023-05-16 07:57:13 +08:00
|
|
|
- name: Rename and move output
|
2023-05-16 06:55:57 +08:00
|
|
|
run: |
|
2023-05-16 07:57:13 +08:00
|
|
|
mv libv4a_re.so libv4a_re_${{ matrix.abi }}.so
|
2023-05-16 06:55:57 +08:00
|
|
|
|
|
|
|
- name: Clean build
|
|
|
|
run: |
|
|
|
|
cmake --build . --target clean
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
2023-05-16 07:07:49 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-05-16 06:55:57 +08:00
|
|
|
with:
|
|
|
|
name: compiled-binaries
|
|
|
|
path: |
|
2023-05-16 07:57:13 +08:00
|
|
|
libv4a_re_*.so
|