forked from quinn-rs/quinn
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.69 KB
/
android.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
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
id: setup-android
uses: android-actions/setup-android@v2
with:
api-level: 30
build-tools: 30.0.3
ndk: 21.3.6528147
- 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: Export ANDROID_NDK_HOME
run: echo "ANDROID_NDK_HOME=${{ steps.setup-android.outputs.ndk_path }}" >> $GITHUB_ENV
- name: Verify ANDROID_NDK_HOME
run: echo $ANDROID_NDK_HOME
- name: Build unit tests for Android
env:
ANDROID_NDK_HOME: ${{ steps.setup-android.outputs.ndk_path }}
run: cargo ndk -t aarch64-linux-android test --no-run
- name: Set up Android Emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: default
arch: x86_64
profile: Nexus 6
emulator-options: "-no-window -no-audio"
- name: Run Tests on Android
run: |
for test in $(find target/aarch64-linux-android/debug/deps/ -type f -executable -name '*-*'); do
adb push "$test" /data/local/tmp/
adb shell chmod +x /data/local/tmp/$(basename "$test")
adb shell /data/local/tmp/$(basename "$test")
done