-
Notifications
You must be signed in to change notification settings - Fork 50
114 lines (98 loc) · 3.02 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
110
111
112
113
114
name: ci
on:
push:
branches: '*'
pull_request:
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
RUSTDOCFLAGS: -Dwarnings
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# See top README for MSRV policy
rust-version: [1.69.0, stable]
steps:
- uses: actions/checkout@v4
# Downgrade all dependencies to their minimum version, both to ensure our
# minimum version bounds are correct and buildable, as well as to satisfy
# our MSRV check when arbitrary dependencies bump their MSRV beyond our
# MSRV in a patch-release.
# This implies that downstream consumers can only rely on our MSRV when
# downgrading various (transitive) dependencies.
- uses: hecrj/setup-rust-action@v2
with:
rust-version: nightly
if: ${{ matrix.rust-version != 'stable' }}
- name: Downgrade dependencies
run: cargo +nightly generate-lockfile -Zminimal-versions
if: ${{ matrix.rust-version != 'stable' }}
- uses: hecrj/setup-rust-action@v2
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 +stable install cargo-ndk
- name: Build game-activity
working-directory: android-activity
run: >
cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
build --features game-activity
- name: Build native-activity
working-directory: android-activity
run: >
cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
build --features native-activity
- name: Build agdk-mainloop example
if: matrix.rust-version == 'stable'
working-directory: examples/agdk-mainloop
run: >
cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
- name: Build na-mainloop example
if: matrix.rust-version == 'stable'
working-directory: examples/na-mainloop
run: >
cargo ndk
-t arm64-v8a
-t armeabi-v7a
-t x86_64
-t x86
-o app/src/main/jniLibs/ -- build
- name: Documentation
run: >
cargo ndk -t arm64-v8a doc --no-deps
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt --all -- --check
working-directory: android-activity
- name: Format na-mainloop example
run: cargo fmt --all -- --check
working-directory: examples/na-mainloop
- name: Format agdk-mainloop example
run: cargo fmt --all -- --check
working-directory: examples/agdk-mainloop