Skip to content

Update rust.yml

Update rust.yml #11

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
paths-ignore:
- "*.md"
- "LICENSE"
pull_request:
branches: [ "main" ]
paths-ignore:
- "*.md"
- "LICENSE"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
env:
ANDROID_NDK_VERSION: "25.1.8937393"
ANDROID_API_LEVEL: 21 # Minimum API level for supported architectures
strategy:
matrix:
target:
- aarch64-linux-android # 64-bit ARM
- armv7-linux-androideabi # 32-bit ARM
- i686-linux-android # 32-bit x86
- x86_64-linux-android # 64-bit x86
- arm-linux-androideabi # 32-bit ARM (older ABI)
- thumbv7neon-linux-androideabi # 32-bit ARM with NEON
name: ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: cargo
- name: Install Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
- name: Set up Android environment variables
run: |
export ANDROID_HOME=$HOME/android-sdk
export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
echo "ANDROID_HOME=${{ env.ANDROID_HOME }}" >> $GITHUB_ENV
echo "PATH=${{ env.PATH }}" >> $GITHUB_ENV
- name: Build - ${{ matrix.target }}
run: cargo build --target ${{ matrix.target }} --verbose
- name: Test - ${{ matrix.target }}
run: cargo test --target ${{ matrix.target }} --verbose