mirror of
https://github.com/actix/actix-web.git
synced 2024-11-22 09:31:10 +00:00
ci: external types checking (#3175)
This commit is contained in:
parent
59e42c1446
commit
2ee92d778e
11 changed files with 181 additions and 24 deletions
25
.github/workflows/lint.yml
vendored
25
.github/workflows/lint.yml
vendored
|
@ -65,6 +65,29 @@ jobs:
|
||||||
RUSTDOCFLAGS: -D warnings
|
RUSTDOCFLAGS: -D warnings
|
||||||
run: cargo +nightly doc --no-deps --workspace --all-features
|
run: cargo +nightly doc --no-deps --workspace --all-features
|
||||||
|
|
||||||
|
check-external-types:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust (nightly-2024-05-01)
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
|
with:
|
||||||
|
toolchain: nightly-2024-05-01
|
||||||
|
|
||||||
|
- name: Install just
|
||||||
|
uses: taiki-e/install-action@v2.38.0
|
||||||
|
with:
|
||||||
|
tool: just
|
||||||
|
|
||||||
|
- name: Install cargo-check-external-types
|
||||||
|
uses: taiki-e/cache-cargo-install-action@v1.2.2
|
||||||
|
with:
|
||||||
|
tool: cargo-check-external-types
|
||||||
|
|
||||||
|
- name: check external types
|
||||||
|
run: just check-external-types-all +nightly-2024-05-01
|
||||||
|
|
||||||
public-api-diff:
|
public-api-diff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -76,7 +99,7 @@ jobs:
|
||||||
- name: Checkout PR branch
|
- name: Checkout PR branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust (nightly-2024-06-07)
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
|
||||||
with:
|
with:
|
||||||
toolchain: nightly-2024-06-07
|
toolchain: nightly-2024-06-07
|
||||||
|
|
|
@ -13,9 +13,14 @@ categories = ["asynchronous", "web-programming::http-server"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_files"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"actix_http::*",
|
||||||
|
"actix_service::*",
|
||||||
|
"actix_web::*",
|
||||||
|
"http::*",
|
||||||
|
"mime::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
|
experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
|
||||||
|
|
|
@ -18,9 +18,17 @@ edition = "2021"
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = []
|
features = []
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_http_test"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"actix_codec::*",
|
||||||
|
"actix_http::*",
|
||||||
|
"actix_server::*",
|
||||||
|
"awc::*",
|
||||||
|
"bytes::*",
|
||||||
|
"futures_core::*",
|
||||||
|
"http::*",
|
||||||
|
"tokio::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -34,9 +34,26 @@ features = [
|
||||||
"compress-zstd",
|
"compress-zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_http"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"actix_codec::*",
|
||||||
|
"actix_service::*",
|
||||||
|
"actix_tls::*",
|
||||||
|
"actix_utils::*",
|
||||||
|
"bytes::*",
|
||||||
|
"bytestring::*",
|
||||||
|
"encoding_rs::*",
|
||||||
|
"futures_core::*",
|
||||||
|
"h2::*",
|
||||||
|
"http::*",
|
||||||
|
"httparse::*",
|
||||||
|
"language_tags::*",
|
||||||
|
"mime::*",
|
||||||
|
"openssl::*",
|
||||||
|
"rustls::*",
|
||||||
|
"tokio_util::*",
|
||||||
|
"tokio::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -16,6 +16,21 @@ edition = "2021"
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
all-features = true
|
all-features = true
|
||||||
|
|
||||||
|
[package.metadata.cargo_check_external_types]
|
||||||
|
allowed_external_types = [
|
||||||
|
"actix_http::*",
|
||||||
|
"actix_multipart_derive::*",
|
||||||
|
"actix_utils::*",
|
||||||
|
"actix_web::*",
|
||||||
|
"bytes::*",
|
||||||
|
"futures_core::*",
|
||||||
|
"mime::*",
|
||||||
|
"serde_json::*",
|
||||||
|
"serde_plain::*",
|
||||||
|
"serde::*",
|
||||||
|
"tempfile::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["tempfile", "derive"]
|
default = ["tempfile", "derive"]
|
||||||
derive = ["actix-multipart-derive"]
|
derive = ["actix-multipart-derive"]
|
||||||
|
|
|
@ -12,9 +12,11 @@ repository = "https://github.com/actix/actix-web"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_router"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"http::*",
|
||||||
|
"serde::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["http", "unicode"]
|
default = ["http", "unicode"]
|
||||||
|
|
|
@ -18,6 +18,22 @@ categories = [
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
[package.metadata.cargo_check_external_types]
|
||||||
|
allowed_external_types = [
|
||||||
|
"actix_codec::*",
|
||||||
|
"actix_http_test::*",
|
||||||
|
"actix_http::*",
|
||||||
|
"actix_service::*",
|
||||||
|
"actix_web::*",
|
||||||
|
"awc::*",
|
||||||
|
"bytes::*",
|
||||||
|
"futures_core::*",
|
||||||
|
"http::*",
|
||||||
|
"openssl::*",
|
||||||
|
"rustls::*",
|
||||||
|
"tokio::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,15 @@ repository = "https://github.com/actix/actix-web"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_web_actors"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"actix::*",
|
||||||
|
"actix_http::*",
|
||||||
|
"actix_web::*",
|
||||||
|
"bytes::*",
|
||||||
|
"bytestring::*",
|
||||||
|
"futures_core::*",
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix = { version = ">=0.12, <0.14", default-features = false }
|
actix = { version = ">=0.12, <0.14", default-features = false }
|
||||||
|
|
|
@ -35,9 +35,31 @@ features = [
|
||||||
"secure-cookies",
|
"secure-cookies",
|
||||||
]
|
]
|
||||||
|
|
||||||
[lib]
|
[package.metadata.cargo_check_external_types]
|
||||||
name = "actix_web"
|
allowed_external_types = [
|
||||||
path = "src/lib.rs"
|
"actix_http::*",
|
||||||
|
"actix_router::*",
|
||||||
|
"actix_rt::*",
|
||||||
|
"actix_server::*",
|
||||||
|
"actix_service::*",
|
||||||
|
"actix_utils::*",
|
||||||
|
"actix_web_codegen::*",
|
||||||
|
"bytes::*",
|
||||||
|
"cookie::*",
|
||||||
|
"cookie",
|
||||||
|
"futures_core::*",
|
||||||
|
"http::*",
|
||||||
|
"language_tags::*",
|
||||||
|
"mime::*",
|
||||||
|
"openssl::*",
|
||||||
|
"rustls::*",
|
||||||
|
"serde_json::*",
|
||||||
|
"serde_urlencoded::*",
|
||||||
|
"serde::*",
|
||||||
|
"serde::*",
|
||||||
|
"tokio::*",
|
||||||
|
"url::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [
|
default = [
|
||||||
|
|
|
@ -15,10 +15,6 @@ repository = "https://github.com/actix/actix-web"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
|
||||||
name = "awc"
|
|
||||||
path = "src/lib.rs"
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
rustdoc-args = ["--cfg", "docsrs"]
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
features = [
|
features = [
|
||||||
|
@ -33,6 +29,27 @@ features = [
|
||||||
"compress-zstd",
|
"compress-zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[package.metadata.cargo_check_external_types]
|
||||||
|
allowed_external_types = [
|
||||||
|
"actix_codec::*",
|
||||||
|
"actix_http::*",
|
||||||
|
"actix_rt::*",
|
||||||
|
"actix_service::*",
|
||||||
|
"actix_tls::*",
|
||||||
|
"bytes::*",
|
||||||
|
"cookie::*",
|
||||||
|
"cookie",
|
||||||
|
"futures_core::*",
|
||||||
|
"h2::*",
|
||||||
|
"http::*",
|
||||||
|
"openssl::*",
|
||||||
|
"rustls::*",
|
||||||
|
"serde_json::*",
|
||||||
|
"serde_urlencoded::*",
|
||||||
|
"serde::*",
|
||||||
|
"tokio::*",
|
||||||
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
|
default = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
|
||||||
|
|
||||||
|
@ -134,7 +151,7 @@ rcgen = "0.13"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
||||||
zstd = "0.13"
|
zstd = "0.13"
|
||||||
tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests
|
tls-rustls-0_23 = { package = "rustls", version = "0.23" } # add rustls 0.23 with default features to make aws_lc_rs work in tests
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "client"
|
name = "client"
|
||||||
|
|
26
justfile
26
justfile
|
@ -74,3 +74,29 @@ doc-watch:
|
||||||
update-readmes: && fmt
|
update-readmes: && fmt
|
||||||
cd ./actix-files && cargo rdme --force
|
cd ./actix-files && cargo rdme --force
|
||||||
cd ./actix-router && cargo rdme --force
|
cd ./actix-router && cargo rdme --force
|
||||||
|
|
||||||
|
# Check for unintentional external type exposure on all crates in workspace.
|
||||||
|
check-external-types-all toolchain="+nightly":
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
exit=0
|
||||||
|
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
|
||||||
|
if ! just check-external-types-manifest "$f" {{toolchain}}; then exit=1; fi
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
exit $exit
|
||||||
|
|
||||||
|
# Check for unintentional external type exposure on all crates in workspace.
|
||||||
|
check-external-types-all-table toolchain="+nightly":
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
|
||||||
|
echo
|
||||||
|
echo "Checking for $f"
|
||||||
|
just check-external-types-manifest "$f" {{toolchain}} --output-format=markdown-table
|
||||||
|
done
|
||||||
|
|
||||||
|
# Check for unintentional external type exposure on a crate.
|
||||||
|
check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="":
|
||||||
|
cargo {{toolchain}} check-external-types --manifest-path "{{manifest_path}}" {{extra_args}}
|
||||||
|
|
Loading…
Reference in a new issue