Skip to content

Commit 5ef1664

Browse files
committed
feat(CI): check external types
This adds CI job that runs `cargo-check-external-types` against a whitelist of exported types.
1 parent 9ed175d commit 5ef1664

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/CI.yml

+24
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,27 @@ jobs:
235235
with:
236236
command: rustdoc
237237
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
238+
239+
check-external-types:
240+
name: Check exposed types
241+
needs: [style, test]
242+
runs-on: ubuntu-latest
243+
steps:
244+
- name: Checkout
245+
uses: actions/checkout@v3
246+
247+
- name: Install Rust
248+
uses: dtolnay/rust-toolchain@nightly-2022-11-16 # Compatible version for cargo-check-external-types
249+
250+
- name: Install cargo-check-external-types
251+
uses: actions-rs/[email protected]
252+
with:
253+
crate: cargo-check-external-types
254+
version: 0.1.6
255+
use-tool-cache: true
256+
257+
- name: check-external-types
258+
uses: actions-rs/cargo@v1
259+
with:
260+
command: check-external-types
261+
args: --config .github/workflows/external-types.toml

.github/workflows/external-types.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
allowed_external_types = [
2+
"bytes::buf::buf_impl::Buf",
3+
"bytes::bytes::Bytes",
4+
"http::header",
5+
"http::header::map::HeaderMap",
6+
"http::method::Method",
7+
"http::request::Request",
8+
"http::response::Response",
9+
"http::status::StatusCode",
10+
"http::uri::Uri",
11+
"http::version::Version",
12+
"http_body::Body",
13+
"http_body::frame::Frame",
14+
"http_body::size_hint::SizeHint",
15+
"tokio::io::async_read::AsyncRead",
16+
"tokio::io::async_write::AsyncWrite"
17+
]

0 commit comments

Comments
 (0)