Skip to content

Commit eb092a7

Browse files
committed
chore(ci): check all feature combinations in CI
1 parent 2a19ab7 commit eb092a7

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

.github/workflows/CI.yml

+18-15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ env:
99
RUST_BACKTRACE: 1
1010

1111
jobs:
12+
ci-pass:
13+
name: CI is green
14+
runs-on: ubuntu-latest
15+
needs:
16+
- style
17+
- test
18+
- features
19+
- doc
20+
steps:
21+
- run: exit 0
22+
1223
style:
1324
name: Check Style
1425
runs-on: ubuntu-latest
@@ -82,17 +93,9 @@ jobs:
8293
args: --benches ${{ matrix.features }}
8394

8495
features:
85-
name: Test Feature ${{ matrix.features }}
96+
name: features
8697
needs: [style]
87-
strategy:
88-
matrix:
89-
features:
90-
- "--features __internal_happy_eyeballs_tests"
91-
- "--no-default-features --features tcp"
92-
- "--no-default-features"
93-
9498
runs-on: ubuntu-latest
95-
9699
steps:
97100
- name: Checkout
98101
uses: actions/checkout@v1
@@ -101,14 +104,14 @@ jobs:
101104
uses: actions-rs/toolchain@v1
102105
with:
103106
profile: minimal
104-
toolchain: stable
107+
toolchain: nightly
105108
override: true
106109

107-
- name: Test
108-
uses: actions-rs/cargo@v1
109-
with:
110-
command: test
111-
args: ${{ matrix.features }}
110+
- name: Install cargo-hack
111+
run: cargo install cargo-hack
112+
113+
- name: check --each-feature
114+
run: cargo hack check --each-feature -Z avoid-dev-deps
112115

113116
doc:
114117
name: Build docs

src/error.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(crate) enum Kind {
4242
#[cfg(any(feature = "http1", feature = "http2"))]
4343
Accept,
4444
/// Error while reading a body from connection.
45-
#[cfg(any(feature = "http1", feature = "http2"))]
45+
#[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
4646
Body,
4747
/// Error while writing a body to connection.
4848
#[cfg(any(feature = "http1", feature = "http2"))]
@@ -225,7 +225,7 @@ impl Error {
225225
Error::new(Kind::UnexpectedMessage)
226226
}
227227

228-
#[cfg(feature = "http1")]
228+
#[cfg(any(feature = "http1", feature = "http2"))]
229229
pub(crate) fn new_io(cause: std::io::Error) -> Error {
230230
Error::new(Kind::Io).with(cause)
231231
}
@@ -249,7 +249,7 @@ impl Error {
249249
Error::new(Kind::ChannelClosed)
250250
}
251251

252-
#[cfg(any(feature = "http1", feature = "http2"))]
252+
#[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
253253
pub(crate) fn new_body<E: Into<Cause>>(cause: E) -> Error {
254254
Error::new(Kind::Body).with(cause)
255255
}
@@ -287,7 +287,7 @@ impl Error {
287287
Error::new_user(User::UnsupportedStatusCode)
288288
}
289289

290-
#[cfg(feature = "http1")]
290+
#[cfg(any(feature = "http1", feature = "http2"))]
291291
pub(crate) fn new_user_absolute_uri_required() -> Error {
292292
Error::new_user(User::AbsoluteUriRequired)
293293
}
@@ -350,7 +350,7 @@ impl Error {
350350
Kind::Listen => "error creating server listener",
351351
#[cfg(any(feature = "http1", feature = "http2"))]
352352
Kind::Accept => "error accepting connection",
353-
#[cfg(any(feature = "http1", feature = "http2"))]
353+
#[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
354354
Kind::Body => "error reading a body from connection",
355355
#[cfg(any(feature = "http1", feature = "http2"))]
356356
Kind::BodyWrite => "error writing a body to connection",

0 commit comments

Comments
 (0)