forked from rust-lang/futures-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
159 lines (142 loc) · 6.11 KB
/
.travis.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
language: rust
sudo: false
# Refs: https://levans.fr/rust_travis_cache.html
cache:
directories:
- /home/travis/.cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
matrix:
include:
# This is the minimum Rust version supported by futures-rs.
# When updating this, the reminder to update the minimum required version in README.md.
- name: cargo check (minimum required version)
rust: 1.36.0
install:
# 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
- if ! cargo hack -V 2>/dev/null; then
cargo install cargo-hack;
fi
script:
# remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- cargo hack --remove-dev-deps --all
# Check no-default-features
- cargo hack check --all --exclude futures-test --ignore-private --no-default-features
# Check alloc feature
- cargo hack check --all --exclude futures-test --ignore-private --no-default-features --features alloc --ignore-unknown-features
# Check std feature
- cargo hack check --all --ignore-private --no-default-features --features std --ignore-unknown-features
# Check compat feature (futures, futures-util)
- cargo hack check -p futures -p futures-util --no-default-features --features std,io-compat
# Check thread-pool feature (futures, futures-executor)
- cargo hack check -p futures -p futures-executor --no-default-features --features std,thread-pool
# 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.
- name: cargo build --features async-await (minimum required version)
rust: 1.39.0
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
# async-await feature is activated by default.
- cargo build --all
- name: cargo +stable build
rust: stable
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --all
- name: cargo +beta build
rust: beta
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --all
- name: cargo test
rust: nightly
os: osx
- name: cargo test
rust: nightly
os: linux
- name: cargo build (with minimal versions)
rust: nightly
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo update -Zminimal-versions
- cargo build --all --all-features
- name: cargo clippy
rust: nightly
install:
- if ! rustup component add clippy 2>/dev/null; then
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy`;
echo "'clippy' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
rustup toolchain install nightly-$target;
rustup default nightly-$target;
rustup component add clippy;
fi
script:
- cargo clippy --all --all-features
- name: cargo bench
rust: nightly
script:
- cargo bench --all
- cargo bench --manifest-path futures-util/Cargo.toml --features=bilock,unstable
- name: cargo build --target=thumbv6m-none-eabi
rust: nightly
install:
- rustup target add thumbv6m-none-eabi
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --manifest-path futures/Cargo.toml
--target thumbv6m-none-eabi
--no-default-features
--features unstable,cfg-target-has-atomic
- cargo build --manifest-path futures/Cargo.toml
--target thumbv6m-none-eabi
--no-default-features
--features unstable,cfg-target-has-atomic,alloc
- cargo build --manifest-path futures/Cargo.toml
--target thumbv6m-none-eabi
--no-default-features
--features unstable,cfg-target-has-atomic,async-await
- name: cargo build --target=thumbv7m-none-eabi
rust: nightly
install:
- rustup target add thumbv7m-none-eabi
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --manifest-path futures/Cargo.toml
--target thumbv7m-none-eabi
--no-default-features
- cargo build --manifest-path futures/Cargo.toml
--target thumbv7m-none-eabi
--no-default-features
--features alloc
- cargo build --manifest-path futures/Cargo.toml
--target thumbv7m-none-eabi
--no-default-features
--features async-await
- name: cargo check (features)
rust: nightly
install:
- cargo install cargo-hack
script:
# Check each specified feature works properly
# * `--each-feature` - run for each feature which includes --no-default-features and default features of package
# * `--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
- cargo hack check
--each-feature --no-dev-deps
--all --exclude futures-test
--features unstable --ignore-unknown-features
- name: cargo doc
rust: nightly
script:
- RUSTDOCFLAGS=-Dwarnings cargo doc --all --no-deps --all-features
script:
- cargo test --all --all-features
- cargo test --all --all-features --release
env:
- RUSTFLAGS=-Dwarnings
notifications:
email:
on_success: never