chore(ci): check all feature combinations in CI

This commit is contained in:
Sean McArthur
2020-11-17 11:04:43 -08:00
parent 2a19ab74ed
commit eb092a7b8c
2 changed files with 23 additions and 20 deletions

View File

@@ -9,6 +9,17 @@ env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
jobs: jobs:
ci-pass:
name: CI is green
runs-on: ubuntu-latest
needs:
- style
- test
- features
- doc
steps:
- run: exit 0
style: style:
name: Check Style name: Check Style
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -82,17 +93,9 @@ jobs:
args: --benches ${{ matrix.features }} args: --benches ${{ matrix.features }}
features: features:
name: Test Feature ${{ matrix.features }} name: features
needs: [style] needs: [style]
strategy:
matrix:
features:
- "--features __internal_happy_eyeballs_tests"
- "--no-default-features --features tcp"
- "--no-default-features"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
@@ -101,14 +104,14 @@ jobs:
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: nightly
override: true override: true
- name: Test - name: Install cargo-hack
uses: actions-rs/cargo@v1 run: cargo install cargo-hack
with:
command: test - name: check --each-feature
args: ${{ matrix.features }} run: cargo hack check --each-feature -Z avoid-dev-deps
doc: doc:
name: Build docs name: Build docs

View File

@@ -42,7 +42,7 @@ pub(crate) enum Kind {
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2"))]
Accept, Accept,
/// Error while reading a body from connection. /// Error while reading a body from connection.
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
Body, Body,
/// Error while writing a body to connection. /// Error while writing a body to connection.
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2"))]
@@ -225,7 +225,7 @@ impl Error {
Error::new(Kind::UnexpectedMessage) Error::new(Kind::UnexpectedMessage)
} }
#[cfg(feature = "http1")] #[cfg(any(feature = "http1", feature = "http2"))]
pub(crate) fn new_io(cause: std::io::Error) -> Error { pub(crate) fn new_io(cause: std::io::Error) -> Error {
Error::new(Kind::Io).with(cause) Error::new(Kind::Io).with(cause)
} }
@@ -249,7 +249,7 @@ impl Error {
Error::new(Kind::ChannelClosed) Error::new(Kind::ChannelClosed)
} }
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
pub(crate) fn new_body<E: Into<Cause>>(cause: E) -> Error { pub(crate) fn new_body<E: Into<Cause>>(cause: E) -> Error {
Error::new(Kind::Body).with(cause) Error::new(Kind::Body).with(cause)
} }
@@ -287,7 +287,7 @@ impl Error {
Error::new_user(User::UnsupportedStatusCode) Error::new_user(User::UnsupportedStatusCode)
} }
#[cfg(feature = "http1")] #[cfg(any(feature = "http1", feature = "http2"))]
pub(crate) fn new_user_absolute_uri_required() -> Error { pub(crate) fn new_user_absolute_uri_required() -> Error {
Error::new_user(User::AbsoluteUriRequired) Error::new_user(User::AbsoluteUriRequired)
} }
@@ -350,7 +350,7 @@ impl Error {
Kind::Listen => "error creating server listener", Kind::Listen => "error creating server listener",
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2"))]
Kind::Accept => "error accepting connection", Kind::Accept => "error accepting connection",
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2", feature = "stream"))]
Kind::Body => "error reading a body from connection", Kind::Body => "error reading a body from connection",
#[cfg(any(feature = "http1", feature = "http2"))] #[cfg(any(feature = "http1", feature = "http2"))]
Kind::BodyWrite => "error writing a body to connection", Kind::BodyWrite => "error writing a body to connection",