-
Notifications
You must be signed in to change notification settings - Fork 110
145 lines (115 loc) · 3.76 KB
/
rust.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Rust
on: [push, pull_request]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-linux-android
- name: Clippy
# Use a cross-compilation target (that's typical for Android) to lint everything
run: cargo clippy --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings
check_ndk_sys_msrv:
name: Check ndk-sys MSRV (1.60.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
target: aarch64-linux-android
- name: cargo check
run: cargo check -p ndk-sys --all-targets --all-features --target aarch64-linux-android
check_msrv:
strategy:
matrix:
minimal-versions: [true, false]
name: Check overall MSRV (1.66.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
if: ${{ matrix.minimal-versions }}
- name: Generate lockfile with minimal dependency versions
run: cargo +nightly generate-lockfile -Zminimal-versions
if: ${{ matrix.minimal-versions }}
- uses: dtolnay/[email protected]
with:
target: aarch64-linux-android
- name: cargo check
run: >
cargo check --workspace --all-targets --all-features --target aarch64-linux-android
|| (echo "::warning::MSRV test failed for minimal-versions: ${{ matrix.minimal-versions }}"; false)
continue-on-error: ${{ !matrix.minimal-versions }}
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-channel: [stable, nightly]
rust-target:
- armv7-linux-androideabi
- aarch64-linux-android
- i686-linux-android
- x86_64-linux-android
include:
- os: windows-latest
rust-channel: stable
rust-target: aarch64-linux-android
- os: windows-latest
rust-channel: stable
rust-target: x86_64-linux-android
runs-on: ${{ matrix.os }}
name: Cross-compile
steps:
- uses: actions/checkout@v4
- name: Installing Rust ${{ matrix.rust-channel }} w/ ${{ matrix.rust-target }}
uses: dtolnay/rust-toolchain@master
with:
target: ${{ matrix.rust-target }}
toolchain: ${{ matrix.rust-channel }}
- name: Compile for ${{ matrix.rust-target }}
run: cargo build --target ${{ matrix.rust-target }}
build-host:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-channel: [stable, nightly]
runs-on: ${{ matrix.os }}
name: Host-side tests
steps:
- uses: actions/checkout@v4
- name: Installing Rust ${{ matrix.rust-channel }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-channel }}
- name: Test ndk-sys
run: cargo test -p ndk-sys --all-features
- name: Test ndk
run: cargo test -p ndk --all-features
docs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-channel: [stable, nightly]
runs-on: ${{ matrix.os }}
name: Build-test docs
steps:
- uses: actions/checkout@v4
- name: Installing Rust ${{ matrix.rust-channel }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-channel }}
- name: Document all crates
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --all --all-features