forked from rust-mobile/rust-android-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 2.66 KB
/
ci.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: ci
on:
push:
branches: [main]
pull_request:
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
RUSTDOCFLAGS: -Dwarnings
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust_version: [stable]
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust_version }}
- name: Install Rust targets
run: >
rustup target add
aarch64-linux-android
armv7-linux-androideabi
x86_64-linux-android
i686-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Setup shared Cargo target
# Each example is in a separate workspace but we want to use
# a shared target to speed up builds of all examples
run: mkdir shared-target
- name: Build agdk-mainloop example
working-directory: agdk-mainloop
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
- name: Build na-mainloop example
working-directory: na-mainloop
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
- name: Build agdk-egui example
working-directory: agdk-egui
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
- name: Build agdk-eframe example
working-directory: agdk-eframe
run: >
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Format
run: |
for dir in agdk-* na-*; do
cd $GITHUB_WORKSPACE/$dir
cargo fmt --all -- --check
done