From 2e0678224164805511eff3ffc283d9ac55b6bf29 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Tue, 31 Mar 2020 15:26:59 -0400 Subject: [PATCH] step 3: make ci work again --- .github/workflows/CI.yml | 62 ++++++++++++++++++++++++++---------- .github/workflows/patch.toml | 11 ------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9e9cd4f..b7816b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -46,24 +46,9 @@ jobs: matrix: crate: - tower - - tower-balance - - tower-buffer - - tower-discover - - tower-filter - - tower-hedge - tower-layer - - tower-limit - - tower-load - - tower-load-shed - - tower-make - - tower-ready-cache - - tower-reconnect - - tower-retry - tower-service - - tower-spawn-ready - tower-test - - tower-timeout - - tower-util steps: - name: Checkout code @@ -94,10 +79,53 @@ jobs: uses: actions-rs/cargo@v1 env: CI: 'True' - RUSTFLAGS: '-D warnings' + # RUSTFLAGS: '-D warnings' with: command: test - args: -p ${{ matrix.crate }} --verbose + args: -p ${{ matrix.crate }} --verbose --all-features + + features: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v1 + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Patch + run: | + set -e + # Remove any existing patch statements + mv Cargo.toml Cargo.toml.bck + sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml + # Patch all crates + cat .github/workflows/patch.toml >> Cargo.toml + # Print `Cargo.toml` for debugging + echo "~~~~ Cargo.toml ~~~~" + cat Cargo.toml + echo "~~~~~~~~~~~~~~~~~~~~" + - name: Install cargo-hack + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-hack + - name: Run feature checks + uses: actions-rs/cargo@v1 + env: + CI: 'True' + with: + command: hack + # Check each feature works properly + # * --each-feature + # run for each feature which includes --no-default-features and default features of package + # * -Z avoid-dev-deps + # build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866 + # tracking-issue: https://github.com/rust-lang/cargo/issues/5133 + args: check -p tower --each-feature -Z avoid-dev-deps rustfmt: diff --git a/.github/workflows/patch.toml b/.github/workflows/patch.toml index 54633ad..91f0b60 100644 --- a/.github/workflows/patch.toml +++ b/.github/workflows/patch.toml @@ -2,17 +2,6 @@ # repository. [patch.crates-io] tower = { path = "tower" } -tower-balance = { path = "tower-balance" } -tower-buffer = { path = "tower-buffer" } -tower-discover = { path = "tower-discover" } -tower-filter = { path = "tower-filter" } tower-layer = { path = "tower-layer" } -tower-limit = { path = "tower-limit" } -tower-load-shed = { path = "tower-load-shed" } -tower-reconnect = { path = "tower-reconnect" } -tower-retry = { path = "tower-retry" } tower-service = { path = "tower-service" } -tower-spawn-ready = { path = "tower-spawn-ready" } tower-test = { path = "tower-test" } -tower-timeout = { path = "tower-timeout" } -tower-util = { path = "tower-util" }