-
Notifications
You must be signed in to change notification settings - Fork 73
233 lines (199 loc) · 6 KB
/
test.yaml
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
227
228
229
230
231
232
233
name: test
on:
push:
branches:
- master
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
test:
name: Build & test
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust:
- stable
- beta
- nightly
# Introduction of self: Arc<..>, needed for the iterator module
- 1.36.0
# Introduction of non_exhaustive, used at certain exfiltrators
- 1.40.0
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
profile: minimal
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Build & test
env:
RUST_VERSION: ${{ matrix.rust }}
OS: ${{ matrix.os }}
run: ./ci-check.sh
rustfmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
components: rustfmt
- run: cargo fmt --all -- --check
links:
name: Check documentation links
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Install cargo-deadlinks
uses: actions-rs/[email protected]
with:
crate: cargo-deadlinks
use-tool-cache: true
- name: Check links
run: |
for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do
cargo rustdoc -p "$package" --all-features -- -D warnings
dname=$(echo "$package" | tr '-' '_')
cargo deadlinks --dir "target/doc/$dname" --check-http --ignore-fragments
done
ancient-registry:
name: Check compilation of signal-hook-registry on 1.26.0
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.26.0
default: true
profile: minimal
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Check compilation
run: |
rm Cargo.toml
cd signal-hook-registry
sed -i -e '/signal-hook =/d' Cargo.toml
cargo check
ancient:
name: Check compilation on 1.31.0
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.31.0
default: true
profile: minimal
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Check compilation
run: |
rm Cargo.lock
cargo update
cargo check --no-default-features
clippy:
name: Clippy lints
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
components: clippy
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Run clippy linter
run: cargo clippy --all --all-features --tests -- -D clippy::all -D warnings
# There's bunch of platforms that have some weird quirks (or we don't know
# that they don't). While fully compiling and testing on them is a bit of a
# challenge, running cargo check on them should be easy enough and should
# catch at least some problems (like different sizes of types).
weird_platforms:
name: Check weird platforms
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- x86_64-pc-solaris
- x86_64-linux-android
- aarch64-linux-android
- arm-linux-androideabi
- mips-unknown-linux-musl
- x86_64-unknown-netbsd
- x86_64-unknown-freebsd
extra-args:
- "--all --all-features"
include:
# - wasm32-wasi (not yet? Or not ever?)
# - x86_64-unknown-redox (Is that platform even usable on stable?)
- { target: x86_64-fuchsia, extra-args: "--all-features" }
- { target: asmjs-unknown-emscripten, extra-args: "--all-features" }
# Seems we have some trouble with properly running C compiler on these. Might as well be problem with cross-compilation setup, but who knows
# So we avoid the exfiltrator part/signal-hook-sys :-(
- { target: x86_64-apple-darwin, extra-args: "--features=iterator --all --exclude signal-hook-sys" }
- { target: x86_64-apple-ios, extra-args: "--features=iterator --all --exclude signal-hook-sys" }
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
target: ${{ matrix.target }}
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Run the check
uses: actions-rs/cargo@v1
with:
command: check
args: ${{ matrix.extra-args }} --tests --target=${{ matrix.target }}
use-cross: true