Skip to content

Commit

Permalink
use workspace dependencies for tower (#778)
Browse files Browse the repository at this point in the history
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
  • Loading branch information
GlenDC and tobz authored Jul 23, 2024
1 parent 88a7d3e commit 85080a5
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 110 deletions.
137 changes: 63 additions & 74 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,60 @@ name: CI
on:
push:
branches:
- master
- master
pull_request: {}

env:
MSRV: 1.63.0
MSRV: 1.64.0

jobs:
check-stable:
# Run `cargo check` first to ensure that the pushed code at least compiles.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Check
run: cargo check --workspace --all-features --all-targets
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check
run: cargo check --workspace --all-features --all-targets

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: cargo doc
working-directory: ${{ matrix.subcrate }}
env:
RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links"
run: cargo doc --all-features --no-deps
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: cargo doc
working-directory: ${{ matrix.subcrate }}
env:
RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links"
run: cargo doc --all-features --no-deps

check-msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: "install Rust nightly"
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Select minimal versions
run: cargo update -Z minimal-versions
- name: Check
run: |
rustup default ${{ env.MSRV }}
cargo check --all --all-targets --all-features --locked
- uses: actions/checkout@v4
- name: "install Rust ${{ env.MSRV }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: "install Rust nightly"
uses: dtolnay/rust-toolchain@nightly
- name: Select minimal versions
run: cargo update -Z minimal-versions
- name: Check
run: |
rustup default ${{ env.MSRV }}
cargo check --all --all-targets --all-features --locked
cargo-hack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack check
working-directory: ${{ matrix.subcrate }}
run: cargo hack check --each-feature --no-dev-deps --workspace
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack check
working-directory: ${{ matrix.subcrate }}
run: cargo hack check --each-feature --no-dev-deps --workspace

test-versions:
# Test against the stable, beta, and nightly Rust toolchains on ubuntu-latest.
Expand All @@ -78,51 +70,48 @@ jobs:
matrix:
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ matrix.rust }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --workspace --all-features
- uses: actions/checkout@v4
- name: "install Rust ${{ matrix.rust }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --workspace --all-features

test-msrv:
needs: check-msrv
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: "install Rust nightly"
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Select minimal versions
run: cargo update -Z minimal-versions
- name: test
run: |
rustup default ${{ env.MSRV }}
cargo check --workspace --all-features --locked
- uses: actions/checkout@v4
- name: "install Rust ${{ env.MSRV }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- name: "install Rust nightly"
uses: dtolnay/rust-toolchain@nightly
- name: Select minimal versions
run: cargo update -Z minimal-versions
- name: test
run: |
rustup default ${{ env.MSRV }}
cargo check --workspace --all-features --locked
style:
needs: check-stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: rustfmt
run: cargo fmt --all -- --check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: rustfmt
run: cargo fmt --all -- --check

deny-check:
name: cargo-deny check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
20 changes: 20 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,23 @@ members = [
"tower-service",
"tower-test",
]

[workspace.dependencies]
futures = "0.3.22"
futures-core = "0.3.22"
futures-util = { version = "0.3.22", default-features = false }
hdrhistogram = { version = "7.0", default-features = false }
http = "0.2"
indexmap = "2.0.2"
lazy_static = "1.4.0"
pin-project-lite = "0.2.7"
quickcheck = "1"
rand = "0.8"
slab = "0.4"
sync_wrapper = "0.1.1"
tokio = "1.6.2"
tokio-stream = "0.1.0"
tokio-test = "0.4"
tokio-util = { version = "0.7.0", default-features = false }
tracing = { version = "0.1.2", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pattern. If your protocol is entirely stream based, Tower may not be a good fit.

Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.63.0.
released at least six months ago. The current MSRV is 1.64.0.

## Getting Started

Expand Down
6 changes: 3 additions & 3 deletions tower-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ edition = "2018"
[dependencies]

[dev-dependencies]
http = "0.2"
http = { workspace = true }
tower-layer = { version = "0.3", path = "../tower-layer" }
tokio = { version = "1", features = ["macros", "time"] }
futures = "0.3.22"
tokio = { workspace = true, features = ["macros", "time"] }
futures = { workspace = true }
10 changes: 5 additions & 5 deletions tower-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ categories = ["asynchronous", "network-programming"]
edition = "2018"

[dependencies]
futures-util = { version = "0.3", default-features = false }
tokio = { version = "1.0", features = ["sync"] }
tokio-test = "0.4"
futures-util = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
tokio-test = { workspace = true }
tower-layer = { version = "0.3", path = "../tower-layer" }
tower-service = { version = "0.3", path = "../tower-service" }
pin-project-lite = "0.2"
pin-project-lite = { workspace = true }

[dev-dependencies]
tokio = { version = "1.0", features = ["macros"] }
tokio = { workspace = true, features = ["macros"] }
48 changes: 24 additions & 24 deletions tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clients and servers.
categories = ["asynchronous", "network-programming"]
keywords = ["io", "async", "non-blocking", "futures", "service"]
edition = "2018"
rust-version = "1.63.0"
rust-version = "1.64.0"

[features]

Expand Down Expand Up @@ -68,32 +68,32 @@ util = ["__common", "futures-util", "pin-project-lite", "sync_wrapper"]
tower-layer = { version = "0.3.1", path = "../tower-layer" }
tower-service = { version = "0.3.1", path = "../tower-service" }

futures-core = { version = "0.3", optional = true }
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
hdrhistogram = { version = "7.0", optional = true, default-features = false }
indexmap = { version = "2.0.2", optional = true }
slab = { version = "0.4", optional = true }
tokio = { version = "1.6", optional = true, features = ["sync"] }
tokio-stream = { version = "0.1.0", optional = true }
tokio-util = { version = "0.7.0", default-features = false, optional = true }
tracing = { version = "0.1.2", default-features = false, features = ["std"], optional = true }
pin-project-lite = { version = "0.2.7", optional = true }
sync_wrapper = { version = "0.1.1", optional = true }
futures-core = { workspace = true, optional = true }
futures-util = { workspace = true, features = ["alloc"], optional = true }
hdrhistogram = { workspace = true, optional = true }
indexmap = { workspace = true, optional = true }
slab = { workspace = true, optional = true }
tokio = { workspace = true, features = ["sync"], optional = true }
tokio-stream = { workspace = true, optional = true }
tokio-util = { workspace = true, optional = true }
tracing = { workspace = true, features = ["std"], optional = true }
pin-project-lite = { workspace = true, optional = true }
sync_wrapper = { workspace = true, optional = true }

[dev-dependencies]
futures = "0.3.22"
hdrhistogram = { version = "7.0", default-features = false }
pin-project-lite = "0.2.7"
tokio = { version = "1.6.2", features = ["macros", "sync", "test-util", "rt-multi-thread"] }
tokio-stream = "0.1"
tokio-test = "0.4"
futures = { workspace = true }
hdrhistogram = { workspace = true }
pin-project-lite = { workspace = true }
tokio = { workspace = true, features = ["macros", "sync", "test-util", "rt-multi-thread"] }
tokio-stream = { workspace = true }
tokio-test = { workspace = true }
tower-test = { version = "0.4", path = "../tower-test" }
tracing = { version = "0.1.2", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] }
http = "0.2"
lazy_static = "1.4.0"
rand = { version = "0.8", features = ["small_rng"] }
quickcheck = "1"
tracing = { workspace = true, features = ["std"] }
tracing-subscriber = { workspace = true, features = ["fmt", "ansi"] }
http = { workspace = true }
lazy_static = { workspace = true }
rand = { workspace = true, features = ["small_rng"] }
quickcheck = { workspace = true }

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions tower/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ application code, libraries providing middleware implementations, and
libraries that implement servers and/or clients for various network
protocols.

Depending on your particular use case, you might use Tower in several ways:
Depending on your particular use case, you might use Tower in several ways:

* **Implementing application logic** for a networked program. You might
use the [`Service`] trait to model your application's behavior, and use
Expand Down Expand Up @@ -174,7 +174,7 @@ Tower.

Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.63.0.
released at least six months ago. The current MSRV is 1.64.0.

## License

Expand Down
2 changes: 1 addition & 1 deletion tower/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
//!
//! Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at
//! least** 6 months. When increasing the MSRV, the new Rust version must have been
//! released at least six months ago. The current MSRV is 1.63.0.
//! released at least six months ago. The current MSRV is 1.64.0.
//!
//! [`Service`]: crate::Service
//! [`Layer`]: crate::Layer
Expand Down

0 comments on commit 85080a5

Please sign in to comment.