Skip to content

Commit

Permalink
ci: external types checking
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Oct 29, 2023
1 parent 3acdda4 commit a140793
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 7 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/clippy-fmt.yml → .github/workflows/lint.yml
Expand Up @@ -17,7 +17,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: nightly
components: rustfmt
Expand All @@ -32,7 +33,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
components: clippy

Expand All @@ -47,7 +49,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: nightly
components: rust-docs
Expand All @@ -57,6 +60,29 @@ jobs:
RUSTDOCFLAGS: -D warnings
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-2023-10-10)
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: nightly-2023-10-10

- name: Install just
uses: taiki-e/install-action@v2.20.2
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@0.1.10

- name: check external types
run: just check-external-types-all

public-api-diff:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,13 +92,15 @@ jobs:

- uses: actions/checkout@v4

- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install Rust (nightly-2023-08-25)
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: nightly-2023-08-25

- uses: taiki-e/cache-cargo-install-action@v1.2.2
- name: Install cargo-public-api
uses: taiki-e/cache-cargo-install-action@v1.2.2
with:
tool: cargo-public-api
tool: cargo-public-api@0.32.0

- name: generate API diff
run: |
Expand Down
21 changes: 21 additions & 0 deletions actix-http/Cargo.toml
Expand Up @@ -23,6 +23,27 @@ rust-version.workspace = true
# features that docs.rs will build with
features = ["http2", "ws", "openssl", "rustls-0_20", "rustls-0_21", "compress-brotli", "compress-gzip", "compress-zstd"]

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"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::*",
]

[lib]
name = "actix_http"
path = "src/lib.rs"
Expand Down
7 changes: 7 additions & 0 deletions justfile
Expand Up @@ -9,3 +9,10 @@ doc:
doc-watch:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl --open
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl

check-external-types-all:
#!/usr/bin/env bash
set -euxo pipefail
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml); do
cargo +nightly check-external-types --manifest-path "$f"
done
4 changes: 3 additions & 1 deletion scripts/bump
Expand Up @@ -93,7 +93,9 @@ fi

# done; remove backup files
rm -f $CARGO_MANIFEST.bak
rm -f $CHANGELOG_FILE.bak
if [ -n "${CHANGELOG_FILE-}" ]; then
rm -f $CHANGELOG_FILE.bak
fi
rm -f $README_FILE.bak

echo "manifest, changelog, and readme updated"
Expand Down

0 comments on commit a140793

Please sign in to comment.