Skip to content

Commit

Permalink
ci: add cargo-check-external-types check (#4914)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti authored Aug 24, 2022
1 parent c9d444e commit d720770
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- test-hyper
- wasm32-unknown-unknown
- wasm32-wasi
- check-external-types
steps:
- run: exit 0

Expand Down Expand Up @@ -513,3 +514,27 @@ jobs:
# TODO: this should become: `cargo hack wasi test --each-feature`
run: cargo wasi test --test rt_yield --features wasi-rt
working-directory: tests-integration

check-external-types:
name: check-external-types
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_nightly }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_nightly }}
override: true
- uses: Swatinem/rust-cache@v1
- name: check-external-types
run: |
set -x
cargo install cargo-check-external-types --locked --version 0.1.3
cargo check-external-types --all-features --config external-types.toml
working-directory: tokio

16 changes: 16 additions & 0 deletions tokio/external-types.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This config file is for the `cargo-check-external-types` tool that is run in CI.

# The following are types that are allowed to be exposed in Tokio's public API.
# The standard library is allowed by default.
allowed_external_types = [
"bytes::buf::buf_impl::Buf",
"bytes::buf::buf_mut::BufMut",

"tokio_macros::*",

# TODO(https://github.com/tokio-rs/tokio/issues/4916): Remove the libc types
"libc::unix::gid_t",
"libc::unix::pid_t",
"libc::unix::uid_t",
]

0 comments on commit d720770

Please sign in to comment.