-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android is the major release target of nntrainer. Build and run test cases for Android. Signed-off-by: MyungJoo Ham <[email protected]>
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Build test/ Android NDK | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
name: Android NDK build on Ubuntu for arm64-v8a | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: -${{ github.event.pull_request.commits }} | ||
- name: Check if rebuild required | ||
uses: ./.github/actions/check-rebuild | ||
with: | ||
mode: android | ||
- if: env.rebuild == '1' | ||
uses: nttld/setup-ndk@v1 | ||
with: | ||
ndk-version: r26d | ||
link-to-sdk: true | ||
## @todo Make cache works (daily update cache on main branch / restore the cache on each PR (w/o saving)) | ||
- name: Prepare Build | ||
if: env.rebuild == '1' | ||
run: | | ||
echo "::group::Install required packages" | ||
sudo apt-get update | ||
sudo apt-get install tar wget gzip libglib2.0-dev libjson-glib-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev googletest liborc-0.4-dev flex bison libopencv-dev pkg-config python3-dev python3-numpy python3 meson ninja-build libflatbuffers-dev flatbuffers-compiler protobuf-compiler | ||
echo "::endgroup::" | ||
- name: NDK Build | ||
if: env.rebuild == '1' | ||
run: | | ||
echo "::group::Run package_android.sh" | ||
./tools/package_android.sh | ||
echo "::endgroup::" | ||
echo "::group::Meson build" | ||
meson build -Dplatform=android | ||
ninja -C build | ||
echo "::endgroup::" | ||
echo "::group::NDK build" | ||
pushd build/jni | ||
ndk-build NDK_PROJECT_PATH=./ APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk | ||
popd | ||
echo "::endgroup::" | ||
- name: Install built binaries for application build | ||
if: env.rebuild == '1' | ||
run: | | ||
echo "Installing build bianries for application build" | ||
mkdir -p libs/arm64-v8a | ||
cp -R build/jni/libs/arm64-v8a/* libs/arm64-v8a | ||
- name: Android NNTrainer Application Build | ||
if: env.rebuild == '1' | ||
run: | | ||
echo "::group::LogisticRegression" | ||
pushd Applications/LogisticRegression/jni | ||
ndk-build NDK_PROJECT_PATH=./ APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk | ||
popd | ||
echo "::endgroup::" |