-
-
Notifications
You must be signed in to change notification settings - Fork 104
46 lines (43 loc) · 1.31 KB
/
rust_android.yml
File metadata and controls
46 lines (43 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Rust Android Build
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
env:
CARGO_TERM_COLOR: always
ANDROID_NDK_HOME: /home/runner/android-ndk-r26d
ANDROID_NDK: /home/runner/android-ndk-r26d
jobs:
android:
runs-on: ubuntu-latest
concurrency:
group: rust-android-${{ github.ref_name }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
submodules: true
- name: Remove unused programs
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /opt/hostedtoolcache/CodeQL
- name: Install NDK r26d
run: |
curl -sSfL -o ndk.zip https://dl.google.com/android/repository/android-ndk-r26d-linux.zip
unzip -q ndk.zip -d /home/runner
rm ndk.zip
- name: Install stable rust toolchain
uses: dtolnay/rust-toolchain@1.90
with:
targets: aarch64-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
if: github.ref != 'refs/heads/main'
with:
shared-key: "rust-android"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build Android example
run: cargo ndk -t arm64-v8a build -p android --lib