-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into server-ffi
- Loading branch information
Showing
89 changed files
with
2,947 additions
and
879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: seanmonstar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ jobs: | |
- ffi | ||
- ffi-header | ||
- doc | ||
- check-external-types | ||
- udeps | ||
steps: | ||
- run: exit 0 | ||
|
||
|
@@ -32,18 +34,19 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
|
||
- name: cargo fmt --check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
run: | | ||
if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then | ||
printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\nSee CONTRIBUTING.md for more details.\n" >&2 | ||
exit 1 | ||
fi | ||
test: | ||
name: Test ${{ matrix.rust }} on ${{ matrix.os }} | ||
|
@@ -73,25 +76,19 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust (${{ matrix.rust }}) | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: ${{ matrix.features }} | ||
run: cargo test ${{ matrix.features }} | ||
|
||
- name: Test all benches | ||
if: matrix.benches | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --benches ${{ matrix.features }} | ||
run: cargo test --benches ${{ matrix.features }} | ||
|
||
msrv: | ||
name: Check MSRV | ||
|
@@ -101,7 +98,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get MSRV from package metadata | ||
id: msrv | ||
|
@@ -113,10 +110,7 @@ jobs: | |
toolchain: ${{ steps.msrv.outputs.version }} | ||
|
||
- name: Check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --features full | ||
run: cargo check --features full | ||
|
||
miri: | ||
name: Test with Miri | ||
|
@@ -125,7 +119,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
@@ -142,76 +136,65 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install cargo-hack | ||
run: cargo install cargo-hack | ||
uses: taiki-e/install-action@cargo-hack | ||
|
||
- name: check --feature-powerset | ||
run: cargo hack check --feature-powerset --depth 2 --skip ffi -Z avoid-dev-deps | ||
run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip ffi,tracing | ||
|
||
ffi: | ||
name: Test C API (FFI) | ||
needs: [style] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Build FFI | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTFLAGS: --cfg hyper_unstable_ffi | ||
with: | ||
command: rustc | ||
args: --features ffi --crate-type cdylib --release | ||
run: cargo rustc --features ffi --crate-type cdylib --release | ||
|
||
- name: Make Examples | ||
run: cd capi/examples && make | ||
|
||
- name: Run FFI unit tests | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTFLAGS: --cfg hyper_unstable_ffi | ||
with: | ||
command: test | ||
args: --features ffi --lib | ||
run: cargo test --features ffi --lib | ||
|
||
ffi-header: | ||
name: Verify hyper.h is up to date | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install cbindgen | ||
uses: actions-rs/cargo@v1 | ||
uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
command: install | ||
args: cbindgen | ||
tool: cbindgen | ||
|
||
- name: Install cargo-expand | ||
uses: actions-rs/cargo@v1 | ||
uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
command: install | ||
args: cargo-expand | ||
tool: cargo-expand | ||
|
||
- name: Build FFI | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTFLAGS: --cfg hyper_unstable_ffi | ||
with: | ||
command: build | ||
args: --features client,http1,http2,ffi | ||
run: cargo build --features client,http1,http2,ffi | ||
|
||
- name: Ensure that hyper.h is up to date | ||
run: ./capi/gen_header.sh --verify | ||
|
@@ -222,13 +205,50 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- name: cargo doc | ||
uses: actions-rs/cargo@v1 | ||
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@v4 | ||
|
||
- 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: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
command: rustdoc | ||
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links | ||
tool: [email protected] | ||
|
||
- name: check-external-types | ||
run: cargo check-external-types --config .github/workflows/external-types.toml | ||
|
||
udeps: | ||
needs: [style] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@nightly | ||
|
||
- name: Install cargo-udeps | ||
uses: taiki-e/install-action@cargo-udeps | ||
|
||
- name: Check unused dependencies on default features | ||
run: cargo udeps | ||
|
||
- name: Check unused dependencies on full features | ||
run: cargo udeps --features full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.