diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f08af14d75..3a415c513e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -235,3 +235,27 @@ jobs: with: command: rustdoc args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links + + check-external-types: + name: Check exposed types + needs: [style, test] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@nightly-2022-11-16 # Compatible version with cargo-check-external-types + + - name: Install cargo-check-external-types + uses: actions-rs/install@v1 + with: + crate: cargo-check-external-types + version: 0.1.6 + use-tool-cache: true + + - name: check-external-types + uses: actions-rs/cargo@v0.1 + with: + command: check-external-types + args: --config .github/workflows/external-types.toml diff --git a/.github/workflows/external-types.toml b/.github/workflows/external-types.toml new file mode 100644 index 0000000000..3f3936a946 --- /dev/null +++ b/.github/workflows/external-types.toml @@ -0,0 +1,17 @@ +allowed_external_types = [ + "bytes::buf::buf_impl::Buf", + "bytes::bytes::Bytes", + "http::header", + "http::header::map::HeaderMap", + "http::method::Method", + "http::request::Request", + "http::response::Response", + "http::status::StatusCode", + "http::uri::Uri", + "http::version::Version", + "http_body::Body", + "http_body::frame::Frame", + "http_body::size_hint::SizeHint", + "tokio::io::async_read::AsyncRead", + "tokio::io::async_write::AsyncWrite" +]