diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 94cbedd3e..c60296707 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,21 +6,18 @@ on: - master pull_request: {} +env: + MSRV: 1.49.0 + jobs: - check: + check-stable: + # Run `cargo check` first to ensure that the pushed code at least compiles. runs-on: ubuntu-latest - strategy: - # Disable fail-fast. If the test run for a particular Rust version fails, - # don't cancel the other test runs, so that we can determine whether a - # failure only occurs on a particular version. - fail-fast: false - matrix: - rust: [stable, 1.49.0] steps: - uses: actions/checkout@master - uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} + toolchain: stable profile: minimal override: true - name: Check @@ -43,6 +40,33 @@ jobs: 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: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.MSRV }} + profile: minimal + - name: "install Rust nightly" + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + - name: Select minimal versions + uses: actions-rs/cargo@v1 + with: + command: update + args: -Z minimal-versions + toolchain: nightly + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --all-targets --all-features --locked + toolchain: ${{ env.MSRV }} + cargo-hack: runs-on: ubuntu-latest steps: @@ -51,16 +75,15 @@ jobs: with: toolchain: stable profile: minimal - - name: Install cargo-hack - run: | - curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin + - 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. - needs: check + needs: check-stable runs-on: ubuntu-latest strategy: # Disable fail-fast. If the test run for a particular Rust version fails, @@ -68,10 +91,11 @@ jobs: # failure only occurs on a particular version. fail-fast: false matrix: - rust: [stable, beta, nightly, 1.49.0] + rust: [stable, beta, nightly] steps: - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 + - name: "install Rust ${{ matrix.rust }}" + uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} profile: minimal @@ -82,8 +106,36 @@ jobs: command: test args: --workspace --all-features + test-msrv: + needs: check-msrv + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: "install Rust ${{ env.MSRV }}" + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.MSRV }} + profile: minimal + - name: "install Rust nightly" + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + - name: Select minimal versions + uses: actions-rs/cargo@v1 + with: + command: update + args: -Z minimal-versions + toolchain: nightly + - name: test + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-features --locked + toolchain: ${{ env.MSRV }} + style: - needs: check + needs: check-stable runs-on: ubuntu-latest steps: - uses: actions/checkout@master diff --git a/tower/Cargo.toml b/tower/Cargo.toml index f6407a4ea..f80b7b1fb 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -70,7 +70,7 @@ 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 } +hdrhistogram = { version = "7.0", optional = true, default-features = false } indexmap = { version = "1.0.2", optional = true } rand = { version = "0.8", features = ["small_rng"], optional = true } slab = { version = "0.4", optional = true } @@ -82,14 +82,15 @@ pin-project-lite = { version = "0.2.7", optional = true } [dev-dependencies] futures = "0.3" -hdrhistogram = "7.0" +hdrhistogram = { version = "7.0", default-features = false } pin-project-lite = "0.2.7" -tokio = { version = "1.6", features = ["macros", "sync", "test-util", "rt-multi-thread"] } +tokio = { version = "1.6.2", features = ["macros", "sync", "test-util", "rt-multi-thread"] } tokio-stream = "0.1" tokio-test = "0.4" tower-test = { version = "0.4", path = "../tower-test" } -tracing-subscriber = "0.2.14" +tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] } http = "0.2" +lazy_static = "1.4.0" [package.metadata.docs.rs] all-features = true