Skip to content

chore(.github): add android workflow #4

chore(.github): add android workflow

chore(.github): add android workflow #4

Workflow file for this run

on: [push, pull_request]
name: CI
jobs:
test:
runs-on: ubuntu-latest
env:
# Set the Android SDK root and NDK path
ANDROID_SDK_ROOT: ${{ runner.temp }}/android-sdk

Check failure on line 12 in .github/workflows/android.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/android.yml (Line: 12, Col: 25): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.temp .github/workflows/android.yml (Line: 13, Col: 25): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.temp
ANDROID_NDK_HOME: ${{ runner.temp }}/android-ndk
ANDROID_HOME: ${{ runner.temp }}/android-sdk
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 30
build-tools: 30.0.3
ndk: 21.3.6528147
- name: Export Android tools paths
run: |
echo "$ANDROID_SDK_ROOT/platform-tools" >> $GITHUB_PATH
echo "$ANDROID_SDK_ROOT/cmdline-tools/tools/bin" >> $GITHUB_PATH
echo "$ANDROID_SDK_ROOT/build-tools/30.0.3" >> $GITHUB_PATH
echo "$ANDROID_NDK_HOME" >> $GITHUB_PATH
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Add Android targets
run: rustup target add aarch64-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Install cargo-mobile
run: cargo install cargo-mobile
- name: Build for Android
run: cargo mobile build --target android
- name: Run Tests on Android
run: cargo mobile test --target android