-
Notifications
You must be signed in to change notification settings - Fork 30
226 lines (201 loc) · 6.92 KB
/
test.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
on:
# Test on PRs for any branch
pull_request:
branches:
- '*'
push:
branches:
- master
# NOTE: Should we use fail-fast: false?
name: Tests
permissions:
contents: read
jobs:
test:
strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.70.0 # MSRV
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- name: Install toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Test debug-mode, default features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
- name: Test debug-mode, all features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --features serde
- name: Test debug-mode, no default features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --no-default-features
- name: Test debug-mode, alloc feature
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --no-default-features --features alloc --tests
- name: Test debug-mode, experimental feature
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --features experimental
- name: Test release-mode, default features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --release
- name: Test release-mode, all features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --release --features serde
- name: Test release-mode, no default features
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --release --no-default-features
- name: Test release-mode, alloc feature
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --release --no-default-features --features alloc --tests
- name: Test release-mode, experimental feature
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --release --features experimental
sanitizers:
name: Tests w. sanitizers
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- name: Install toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
override: true
# Release (LeakSanitizer is enabled by default with AddressSanitizer for x86_64 Linux builds)
# https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
- run: RUSTFLAGS="-Z sanitizer=address" ASAN_OPTIONS="detect_odr_violation=0" cargo test --all-features --tests --release --target x86_64-unknown-linux-gnu
- run: RUSTFLAGS="-Z sanitizer=address" ASAN_OPTIONS="detect_odr_violation=0" cargo test --no-default-features --tests --release --target x86_64-unknown-linux-gnu
no_std:
name: no_std build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: thumbv7em-none-eabi
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
use-cross: true
command: build
args: --release --no-default-features --target thumbv7em-none-eabi
cross_compilation:
name: Linux/ARM - Release tests
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- i686-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- powerpc64-unknown-linux-gnu
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
target: ${{ matrix.arch }}
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
use-cross: true
command: test
args: --release --target ${{ matrix.arch }}
# https://rustwasm.github.io/docs/book/reference/add-wasm-support-to-crate.html#maintaining-ongoing-support-for-webassembly
web_assembly:
name: WebAssembly - Release build
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
target: ${{ matrix.arch }}
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: check
args: --no-default-features --target ${{ matrix.arch }}
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: doc
args: --no-deps --all-features
benches:
name: Build and check benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --benches