Fix Android compilation errors #2
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: Build for Android | ||
on: | ||
push: | ||
branches: | ||
- test | ||
pull_request: | ||
branches: | ||
- test | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
ANDROID_NDK_VERSION: "25" # 指定 Android NDK 版本 | ||
ANDROID_NDK_HOME: ${{ runner.temp }}/android-ndk | ||
Check failure on line 17 in .github/workflows/build.yml GitHub Actions / Build for AndroidInvalid workflow file
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Download and set up Android NDK | ||
run: | | ||
wget https://dl.google.com/android/repository/android-ndk-${{ env.ANDROID_NDK_VERSION }}-linux-x86_64.zip -O android-ndk.zip | ||
mkdir -p $ANDROID_NDK_HOME | ||
unzip android-ndk.zip -d $ANDROID_NDK_HOME | ||
env: | ||
ANDROID_NDK_HOME: ${{ runner.temp }}/android-ndk | ||
- name: Install Rust toolchain for aarch64-linux-android | ||
run: rustup target add aarch64-linux-android | ||
- name: Build with Cargo | ||
run: | | ||
export NDK_HOME=${{ ANDROID_NDK_HOME }}/android-ndk-${{ env.ANDROID_NDK_VERSION }} | ||
cargo build --target aarch64-linux-android --release |