Skip to content

Commit 385bbd8

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 52f1925 commit 385bbd8

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,26 @@ jobs:
210210

211211
- name: cargo doc
212212
run: cargo rustdoc --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
213+
214+
check-external-types:
215+
name: Check exposed types
216+
needs: [style, test]
217+
runs-on: ubuntu-latest
218+
steps:
219+
- name: Checkout
220+
uses: actions/checkout@v3
221+
222+
- name: Install Rust
223+
uses: dtolnay/rust-toolchain@master
224+
with:
225+
toolchain: nightly-2023-05-31 # Compatible version for cargo-check-external-types
226+
227+
- name: Install cargo-check-external-types
228+
uses: actions-rs/install@v0.1
229+
with:
230+
crate: cargo-check-external-types
231+
version: 0.1.7
232+
use-tool-cache: true
233+
234+
- name: check-external-types
235+
run: cargo check-external-types --config .github/workflows/external-types.toml
Lines changed: 17 additions & 0 deletions
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)