Skip to content

Commit 511e0b3

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 9feb70e commit 511e0b3

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- ffi
2525
- ffi-header
2626
- doc
27+
- check-external-types
2728
steps:
2829
- run: exit 0
2930

@@ -210,3 +211,26 @@ jobs:
210211

211212
- name: cargo doc
212213
run: cargo rustdoc --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links
214+
215+
check-external-types:
216+
name: Check exposed types
217+
needs: [style, test]
218+
runs-on: ubuntu-latest
219+
steps:
220+
- name: Checkout
221+
uses: actions/checkout@v3
222+
223+
- name: Install Rust
224+
uses: dtolnay/rust-toolchain@master
225+
with:
226+
toolchain: nightly-2023-05-31 # Compatible version for cargo-check-external-types
227+
228+
- name: Install cargo-check-external-types
229+
uses: actions-rs/[email protected]
230+
with:
231+
crate: cargo-check-external-types
232+
version: 0.1.7
233+
use-tool-cache: true
234+
235+
- name: check-external-types
236+
run: cargo check-external-types --config .github/workflows/external-types.toml

.github/workflows/external-types.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
]

0 commit comments

Comments
 (0)