Try cargo public-api-crates on CI (#1761)

This commit is contained in:
David Pedersen 2023-02-16 22:41:41 +01:00 committed by GitHub
parent c18ff9dd63
commit e6ff0281ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 0 deletions

View file

@ -74,6 +74,25 @@ jobs:
- name: cargo hack check
run: cargo hack check --each-feature --no-dev-deps --all
cargo-public-api-crates:
runs-on: ubuntu-latest
strategy:
matrix:
crate: [axum, axum-core, axum-extra, axum-macros]
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: Install cargo-public-api-crates
run: |
cargo install --git https://github.com/davidpdrsn/cargo-public-api-crates
- name: cargo public-api-crates check
run: cargo public-api-crates --manifest-path ${{ matrix.crate }}/Cargo.toml check
test-versions:
needs: check
runs-on: ubuntu-latest

View file

@ -30,3 +30,12 @@ futures-util = "0.3"
hyper = "0.14"
tokio = { version = "1.0", features = ["macros"] }
tower-http = { version = "0.3.4", features = ["limit"] }
[package.metadata.cargo-public-api-crates]
allowed = [
"futures_core",
"http",
"bytes",
"http_body",
"tower_layer",
]

View file

@ -73,3 +73,22 @@ tower-http = { version = "0.3", features = ["map-response-body", "timeout"] }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.cargo-public-api-crates]
allowed = [
"axum",
"axum_core",
"bytes",
"cookie",
"futures_core",
"futures_util",
"http",
"http_body",
"hyper",
"percent_encoding",
"prost",
"serde",
"tokio",
"tower_layer",
"tower_service",
]

View file

@ -37,3 +37,6 @@ serde_json = "1.0"
syn = { version = "1.0", features = ["full", "extra-traits"] }
tokio = { version = "1.0", features = ["full"] }
trybuild = "1.0.63"
[package.metadata.cargo-public-api-crates]
allowed = []

View file

@ -110,6 +110,23 @@ features = [
"ws",
]
[package.metadata.cargo-public-api-crates]
allowed = [
"axum_core",
"bytes",
"futures_core",
"futures_sink",
"futures_util",
"headers_core",
"http",
"http_body",
"hyper",
"serde",
"serde_json",
"tower_layer",
"tower_service",
]
[[bench]]
name = "benches"
harness = false