Android Build #149
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 Build | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "README.md" | |
- ".github/workflows/**" | |
- ".gitignore" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r25b | |
ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin | |
NDK_URL: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set clang as the default compiler | |
run: | | |
sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 | |
sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 | |
sudo update-alternatives --set cc $(which clang) | |
sudo update-alternatives --set c++ $(which clang++) | |
- name: Download Android NDK | |
run: | | |
mkdir -p "${{github.workspace}}/android-ndk" | |
cd "${{github.workspace}}/android-ndk" | |
curl -o ndk.zip ${{ env.NDK_URL }} | |
unzip ndk.zip | |
rm ndk.zip | |
echo "$ANDROID_TOOLCHAIN" >> $GITHUB_PATH | |
- name: Add Rust targets | |
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android | |
- name: Install bindgen | |
run: cargo install cbindgen | |
- name: Install Ninja | |
run: sudo apt install ninja-build -y | |
- name: Configure CMake | |
run: cmake -S build/Android/ -DANDROID_ABI="arm64-v8a" -B build/Android/Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DCMAKE_BUILD_TYPE=Release -G Ninja | |
- name: Build project | |
run: cmake --build build/Android/Release --config Release -j |