Skip to content

Commit d4fb6ec

Browse files
authored
Merge pull request #1 from rust-mobile/ci
Add initial .github/workflows/ci.yml
2 parents d15ca31 + 883619a commit d4fb6ec

File tree

8 files changed

+116
-7
lines changed

8 files changed

+116
-7
lines changed

.github/workflows/ci.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CARGO_INCREMENTAL: 0
10+
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
11+
RUSTDOCFLAGS: -Dwarnings
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
rust_version: [stable]
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- uses: hecrj/setup-rust-action@v1
24+
with:
25+
rust-version: ${{ matrix.rust_version }}
26+
27+
- name: Install Rust targets
28+
run: >
29+
rustup target add
30+
aarch64-linux-android
31+
armv7-linux-androideabi
32+
x86_64-linux-android
33+
i686-linux-android
34+
35+
- name: Install cargo-ndk
36+
run: cargo install cargo-ndk
37+
38+
- name: Setup Java
39+
uses: actions/setup-java@v3
40+
with:
41+
distribution: 'temurin'
42+
java-version: '17'
43+
44+
- name: Setup Android SDK
45+
uses: android-actions/setup-android@v2
46+
47+
- name: Setup shared Cargo target
48+
# Each example is in a separate workspace but we want to use
49+
# a shared target to speed up builds of all examples
50+
run: mkdir shared-target
51+
52+
- name: Build agdk-mainloop example
53+
working-directory: agdk-mainloop
54+
run: >
55+
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
56+
-t arm64-v8a
57+
-t armeabi-v7a
58+
-t x86_64
59+
-t x86
60+
-o app/src/main/jniLibs/ -- build
61+
62+
- name: Build na-mainloop example
63+
working-directory: na-mainloop
64+
run: >
65+
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
66+
-t arm64-v8a
67+
-t armeabi-v7a
68+
-t x86_64
69+
-t x86
70+
-o app/src/main/jniLibs/ -- build
71+
72+
- name: Build agdk-egui example
73+
working-directory: agdk-egui
74+
run: >
75+
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
76+
-t arm64-v8a
77+
-t armeabi-v7a
78+
-t x86_64
79+
-t x86
80+
-o app/src/main/jniLibs/ -- build
81+
82+
- name: Build agdk-eframe example
83+
working-directory: agdk-eframe
84+
run: >
85+
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/shared-target cargo ndk
86+
-t arm64-v8a
87+
-t armeabi-v7a
88+
-t x86_64
89+
-t x86
90+
-o app/src/main/jniLibs/ -- build
91+
92+
format:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v2
96+
97+
- uses: actions-rs/toolchain@v1
98+
with:
99+
profile: minimal
100+
toolchain: stable
101+
override: true
102+
components: rustfmt
103+
104+
- name: Format
105+
run: |
106+
for dir in agdk-* na-*; do
107+
cd $GITHUB_WORKSPACE/$dir
108+
cargo fmt --all -- --check
109+
done

agdk-cpal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
log = "0.4"
1010
android_logger = "0.11.0"
11-
android-activity = { path="../../android-activity", features = ["game-activity"] }
11+
android-activity = { version = "0.4", features = ["game-activity"] }
1212
cpal = "0.14"
1313
atomic_float = "0.1"
1414
anyhow = "1"

agdk-mainloop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
log = "0.4"
1010
android_logger = "0.11.0"
11-
android-activity = { path="../../android-activity", features = ["game-activity"] }
11+
android-activity = { version = "0.4", features = ["game-activity"] }
1212

1313
[lib]
1414
name="main"

agdk-oboe/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
log = "0.4"
1010
android_logger = "0.11.0"
11-
android-activity = { path="../../android-activity", features = ["game-activity"] }
11+
android-activity = { version = "0.4", features = ["game-activity"] }
1212
oboe = { version = "0.4", features = ["java-interface"] }
1313
atomic_float = "0.1"
1414

na-mainloop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
log = "0.4"
1010
android_logger = "0.11.0"
11-
android-activity = { path="../../android-activity", features = [ "native-activity" ] }
11+
android-activity = { version = "0.4", features = [ "native-activity" ] }
1212

1313
[lib]
1414
#name="na_mainloop"

na-openxr-info/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env_logger = "0.9"
1414

1515
[target.'cfg(target_os = "android")'.dependencies]
1616
android_logger = "0.11.0"
17-
android-activity = { path="../../android-activity", features = ["native-activity"] }
17+
android-activity = { version = "0.4", features = ["native-activity"] }
1818

1919
[patch.crates-io]
2020
# openxr 0.16 uses ndk-glue, but master uses ndk-context which is compatible with android-activity

na-openxr-wgpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ctrlc = "3"
2121

2222
[target.'cfg(target_os = "android")'.dependencies]
2323
android_logger = "0.11.0"
24-
android-activity = { path="../../android-activity", features = [ "native-activity" ] }
24+
android-activity = { version = "0.4", features = [ "native-activity" ] }
2525
openxr = { version = "0.16", features = [ "linked" ] }
2626

2727
[patch.crates-io]

na-subclass-jni/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
[dependencies]
99
log = "0.4"
1010
android_logger = "0.11.0"
11-
android-activity = { path="../../android-activity", features = [ "native-activity" ] }
11+
android-activity = { version = "0.4", features = [ "native-activity" ] }
1212
ndk-context = "0.1"
1313
jni = "0.19"
1414

0 commit comments

Comments
 (0)