-
Notifications
You must be signed in to change notification settings - Fork 605
269 lines (253 loc) · 10.6 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
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 1 * * *'
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
defaults:
run:
shell: bash
jobs:
test:
name: cargo +${{ matrix.rust }} test (${{ matrix.os }})
strategy:
matrix:
rust:
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: cargo test --workspace --all-features
- run: cargo test --workspace --all-features --release
core-msrv:
name: cargo +${{ matrix.rust }} build (futures-{core, io, sink, task, channel})
strategy:
matrix:
rust:
# This is the minimum Rust version supported by futures-core, futures-io, futures-sink, futures-task, futures-channel.
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
- 1.36.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
# cargo does not support for --features/--no-default-features with workspace, so use cargo-hack instead.
# Refs: cargo#3620, cargo#4106, cargo#4463, cargo#4753, cargo#5015, cargo#5364, cargo#6195
- run: cargo install cargo-hack
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- run: cargo hack --remove-dev-deps --workspace
# Check no-default-features
- run: |
cargo hack build --workspace --ignore-private --no-default-features \
--exclude futures --exclude futures-util --exclude futures-macro --exclude futures-executor --exclude futures-test
# Check alloc feature
- run: |
cargo hack build --workspace --ignore-private --no-default-features --features alloc --ignore-unknown-features \
--exclude futures --exclude futures-util --exclude futures-macro --exclude futures-executor --exclude futures-test
# Check std feature
- run: |
cargo hack build --workspace --ignore-private --no-default-features --features std \
--exclude futures --exclude futures-util --exclude futures-macro --exclude futures-executor --exclude futures-test
util-msrv:
name: cargo +${{ matrix.rust }} build
strategy:
matrix:
rust:
# This is the minimum Rust version supported by futures, futures-util, futures-macro, futures-executor, futures-test.
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
- 1.37.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo install cargo-hack
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- run: cargo hack --remove-dev-deps --workspace
# Check no-default-features
- run: cargo hack build --workspace --exclude futures-test --ignore-private --no-default-features
# Check alloc feature
- run: cargo hack build --workspace --exclude futures-test --ignore-private --no-default-features --features alloc --ignore-unknown-features
# Check std feature
- run: cargo hack build --workspace --ignore-private --no-default-features --features std --ignore-unknown-features
# Check compat feature (futures, futures-util)
- run: cargo hack build -p futures -p futures-util --no-default-features --features std,io-compat
# Check thread-pool feature (futures, futures-executor)
- run: cargo hack build -p futures -p futures-executor --no-default-features --features std,thread-pool
async-await-msrv:
name: cargo +${{ matrix.rust }} build
strategy:
matrix:
rust:
# This is the minimum Rust version supported by `async-await` feature.
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
- 1.39.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo install cargo-hack
- run: cargo hack build --workspace --no-dev-deps
build:
name: cargo +${{ matrix.rust }} build
strategy:
matrix:
rust:
- stable
- beta
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo install cargo-hack
- run: cargo hack build --workspace --no-dev-deps
- run: cargo build --tests --features default,thread-pool,io-compat --manifest-path futures/Cargo.toml
minimal-versions:
name: cargo build -Z minimal-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo install cargo-hack
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- run: cargo hack --remove-dev-deps --workspace
- run: cargo update -Z minimal-versions
- run: cargo build --workspace --all-features
thumbv6m:
name: cargo build --target thumbv6m-none-eabi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup target add thumbv6m-none-eabi
- run: cargo install cargo-hack
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- run: cargo hack --remove-dev-deps --workspace
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv6m-none-eabi \
--no-default-features \
--features unstable,cfg-target-has-atomic
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv6m-none-eabi \
--no-default-features \
--features alloc,unstable,cfg-target-has-atomic
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv6m-none-eabi \
--no-default-features \
--features async-await,unstable,cfg-target-has-atomic
thumbv7m:
name: cargo build --target thumbv7m-none-eabi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup target add thumbv7m-none-eabi
- run: cargo install cargo-hack
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- run: cargo hack --remove-dev-deps --workspace
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv7m-none-eabi \
--no-default-features \
--features unstable,cfg-target-has-atomic
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv7m-none-eabi \
--no-default-features \
--features alloc
- run: |
cargo build --manifest-path futures/Cargo.toml \
--target thumbv7m-none-eabi \
--no-default-features \
--features async-await
bench:
name: cargo bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo bench --workspace
- run: cargo bench --manifest-path futures-util/Cargo.toml --features=bilock,unstable
features:
name: cargo hack check --feature-powerset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo install cargo-hack
# Check each specified feature works properly
# * `--feature-powerset` - run for the feature powerset of the package
# * `--depth 2` - limit the max number of simultaneous feature flags of `--feature-powerset`
# * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
# * `--exclude futures-test` - futures-test cannot be compiled with no-default features
# * `--features unstable` - some features cannot be compiled without this feature
# * `--ignore-unknown-features` - some crates doesn't have 'unstable' feature
- run: |
cargo hack check \
--feature-powerset --depth 2 --no-dev-deps \
--workspace --exclude futures-test \
--features unstable --ignore-unknown-features
san:
name: cargo test -Z sanitizer=${{ matrix.sanitizer }}
strategy:
matrix:
sanitizer:
- address
- memory
- thread
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup component add rust-src
- run: cargo -Z build-std test --workspace --all-features --target x86_64-unknown-linux-gnu --lib --tests
env:
# TODO: Once `cfg(sanitize = "..")` is stable, replace
# `cfg(futures_sanitizer)` with `cfg(sanitize = "..")` and remove
# `--cfg futures_sanitizer`.
RUSTFLAGS: -D warnings -Z sanitizer=${{ matrix.sanitizer }} --cfg futures_sanitizer
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Clippy
run: |
toolchain=nightly-$(curl -sSf https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)
rustup set profile minimal
rustup default "$toolchain"
rustup component add clippy
- run: cargo clippy --workspace --all-features --all-targets
docs:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --workspace --no-deps --all-features