Skip to content

Commit

Permalink
feat(CI): check external types
Browse files Browse the repository at this point in the history
This adds CI job that runs `cargo-check-external-types` against a
whitelist of exported types.
  • Loading branch information
palango committed Mar 1, 2023
1 parent 9ed175d commit e058d23
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,29 @@ 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@master
with:
toolchain: nightly-2022-11-16 # Compatible version for cargo-check-external-types

- name: Install cargo-check-external-types
uses: actions-rs/install@v0.1
with:
crate: cargo-check-external-types
version: 0.1.6
use-tool-cache: true

- name: check-external-types
uses: actions-rs/cargo@v1
with:
command: check-external-types
args: --config .github/workflows/external-types.toml
17 changes: 17 additions & 0 deletions .github/workflows/external-types.toml
Original file line number Diff line number Diff line change
@@ -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"
]

0 comments on commit e058d23

Please sign in to comment.