Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,62 @@ jobs:
if [ -L "$COMPUTE_FLOW_TEST_MODEL_HOME" ]; then
unlink "$COMPUTE_FLOW_TEST_MODEL_HOME"
fi

cmake-build-android:
name: Android™ ARM64 from source (CMake)
runs-on: ubuntu-24.04
timeout-minutes: 360
env:
ANDROID_NDK_VERSION: "27.3.13750724"
CMAKE_BUILD_PARALLEL_LEVEL: "4"
COMPUTE_FLOW_HOME: ${{ github.workspace }}/.compute-flow
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
python-version: "3.12"
# TODO: Test a user-provided NDK via COMPUTE_FLOW_ANDROID_NDK_ROOT.
- name: Select Android™ NDK
run: |
ndk="$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION"
if [ ! -f "$ndk/build/cmake/android.toolchain.cmake" ]; then
sdkmanager "ndk;$ANDROID_NDK_VERSION"
fi
echo "NDK=$ndk" >> "$GITHUB_ENV"
- name: Install Python dependencies
run: uv sync --locked --no-default-groups --group build --group bricks --group tests
- name: Install bricks
run: |
uv run compute-flow update
uv run compute-flow brick install --all
uv run compute-flow brick list
# TODO: Check whether `compute-flow build android_arm64 --from-source` can
# replace the direct CMake configuration and build commands.
- name: Configure with CMake
run: |
uv run cmake -S . -B build_android_arm64 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO to check whether we can use the brick manager. Also, I would add a TODO to test user provided NDK

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-DCMAKE_TOOLCHAIN_FILE="$NDK/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$PWD/build_android_arm64/install" \
-DCOMPUTE_FLOW_USE_PREBUILT_DEPS=OFF \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Compute Flow documentation says a full rebuild requires 18 GB of storage, but as far as I know, GitHub provides only 14 GB by default. The documented 18 GB may include a safety margin.

-DCOMPUTE_FLOW_BUILD_PROTOBUF_FROM_SOURCE=ON \
-DCOMPUTE_FLOW_BUILD_LITERT_FROM_SOURCE=ON \
-DCOMPUTE_FLOW_BUILD_EXECUTORCH_FROM_SOURCE=ON \
-DCOMPUTE_FLOW_BUILD_ONNXRUNTIME_FROM_SOURCE=ON \
-DCOMPUTE_FLOW_BUILD_MNN_FROM_SOURCE=ON \
-DCOMPUTE_FLOW_BUILD_SENTENCEPIECE_FROM_SOURCE=ON
- name: Build with CMake
run: uv run cmake --build build_android_arm64 --parallel "$CMAKE_BUILD_PARALLEL_LEVEL"
- name: Package SDK and install
run: |
uv run cmake --build build_android_arm64 --target compute_flow_application_sdk --parallel "$CMAKE_BUILD_PARALLEL_LEVEL"
uv run cmake --install build_android_arm64
- name: Collect CLI binaries
run: |
mkdir -p artifacts
find build_android_arm64 -type f -name '*_cli' -exec cp {} artifacts/ \;
test -n "$(find artifacts -type f -name '*_cli' -print -quit)"
Loading