Skip to content

Commit

Permalink
chore(ci): check external types (hyperium#3152)
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.

Closes hyperium#2925

Signed-off-by: Sven Pfennig <[email protected]>
  • Loading branch information
palango authored and 0xE282B0 committed Jan 16, 2024
1 parent 9bba5f9 commit 25ab0f9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- ffi
- ffi-header
- doc
- check-external-types
steps:
- run: exit 0

Expand Down Expand Up @@ -210,3 +211,26 @@ jobs:

- name: cargo doc
run: cargo rustdoc --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-2023-05-31 # Compatible version for cargo-check-external-types

- name: Install cargo-check-external-types
uses: actions-rs/[email protected]
with:
crate: cargo-check-external-types
version: 0.1.7
use-tool-cache: true

- name: check-external-types
run: cargo check-external-types --config .github/workflows/external-types.toml
15 changes: 15 additions & 0 deletions .github/workflows/external-types.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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",
]

0 comments on commit 25ab0f9

Please sign in to comment.