Develop #141
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
# This is a basic workflow to help you get started with Actions | |
name: Android Build | |
# Controls when the workflow will run | |
# Triggers the workflow on push or pull request events and manually from the Actions tab | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'README.md' | |
- '.github/workflows/**' | |
- '.gitignore' | |
pull_request: | |
workflow_dispatch: | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 8 | |
jobs: | |
Android: | |
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" | |
MAKEFLAGS: "-j 8" | |
steps: | |
- name: Setup Git to make sure crlf -> lf | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
#- uses: nttld/setup-ndk@v1 | |
# id: setup-ndk | |
# with: | |
# ndk-version: r21e | |
- name: Download Android NDK | |
run: | | |
mkdir "${{github.workspace}}/android-ndk" | |
cd "${{github.workspace}}/android-ndk" | |
curl -o ndk.zip ${{ env.NDK_URL }} | |
unzip ndk.zip | |
rm ndk.zip | |
- name: Install Rust dependencies | |
run: | | |
rustup update | |
rustup toolchain install stable | |
rustup default stable | |
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android | |
cargo install cbindgen | |
- name: Create Build Directory | |
run: cmake -E make_directory ${{github.workspace}}/.build | |
- name: Set PATH | |
run: echo "${{env.ANDROID_TOOLCHAIN}}" >> $GITHUB_PATH | |
- name: Configure CMake | |
env: | |
CC: clang | |
working-directory: ${{github.workspace}}/.build | |
run: | | |
export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} | |
export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} | |
export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} | |
echo $PATH | |
export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH | |
echo $PATH | |
echo $CC | |
ls -la $ANDROID_TOOLCHAIN | |
echo "Check clang path:" | |
which clang | |
env | |
cmake -S ../build/Android/ -DANDROID_ABI="arm64-v8a" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang | |
- name: Compile | |
working-directory: ${{github.workspace}}/.build | |
run: make | |