From 7445ee44235d5742ca22650107cc8e2263834dcf Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 1 Oct 2019 18:46:36 -0400 Subject: [PATCH 1/5] Add CI workflow --- .github/workflows/CI.yml | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..b6f0fc9cc --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,64 @@ +name: CI +on: [push] +jobs: + check: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macOS-latest] + rust: [beta] + + steps: + - uses: hecrj/setup-rust-action@master + with: + rust-version: ${{ matrix.rust }} + - uses: actions/checkout@master + - name: Install rustfmt + run: rustup component add rustfmt + - name: Check fmt + run: cargo fmt -- --check + - name: Check all + run: cargo check --all + - name: Check with no default features + run: cargo check -p tonic --no-default-features + - name: Check with transport no tls + run: cargo check -p tonic + - name: Check with transport w/ openssl + run: cargo check -p tonic --features openssl + - name: Check with transport w/ rustls + run: cargo check -p tonic --features rustls + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + rust: [beta] + + steps: + - uses: hecrj/setup-rust-action@master + with: + rust-version: ${{ matrix.rust }} + - uses: actions/checkout@master + - name: Run tests + run: cargo test --all --all-features + + interop: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macOS-latest] + rust: [beta] + + steps: + - uses: hecrj/setup-rust-action@master + with: + rust-version: ${{ matrix.rust }} + - uses: actions/checkout@master + - name: Install rustfmt + run: rustup component add rustfmt + - name: Run interop tests + run: ./tonic-interop/test.sh + - name: Run interop tests with tls + run: ./tonic-interop/test.sh --use_tls + From af59580b8011ed2e71151d08840ef292a0bbf4fb Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 1 Oct 2019 18:47:13 -0400 Subject: [PATCH 2/5] Delete interop.yml --- .github/workflows/interop.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/interop.yml diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml deleted file mode 100644 index e302d136e..000000000 --- a/.github/workflows/interop.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: interop -on: [push] -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macOS-latest] - rust: [beta] - - steps: - - uses: hecrj/setup-rust-action@master - with: - rust-version: ${{ matrix.rust }} - - uses: actions/checkout@master - - name: Install rustfmt - run: rustup component add rustfmt - - name: Run interop tests - run: ./tonic-interop/test.sh - - name: Run interop tests with tls - run: ./tonic-interop/test.sh --use_tls From 7507ddb67b918e7d88bd266a4b55460cefef9229 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 1 Oct 2019 18:47:22 -0400 Subject: [PATCH 3/5] Delete test.yml --- .github/workflows/test.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 50ac25dbf..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: test -on: [push] -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - rust: [beta] - - steps: - - uses: hecrj/setup-rust-action@master - with: - rust-version: ${{ matrix.rust }} - - uses: actions/checkout@master - - name: Install rustfmt - run: rustup component add rustfmt - - name: Check fmt - run: cargo fmt -- --check - - name: Check all - run: cargo check --all - - name: Check with no default features - run: cargo check -p tonic --no-default-features - - name: Check with transport no tls - run: cargo check -p tonic - - name: Check with transport w/ openssl - run: cargo check -p tonic --features openssl - - name: Check with transport w/ rustls - run: cargo check -p tonic --features rustls - - name: Run tests - run: cargo test --all --all-features From b2511f4bc5d69fd4e2e8d6aad38efac7d16de95a Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 1 Oct 2019 19:01:45 -0400 Subject: [PATCH 4/5] deny warnings --- .github/workflows/CI.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b6f0fc9cc..f6a80ed5d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -5,9 +5,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest] rust: [beta] + env: + RUSTFLAGS: "-D warnings" + steps: - uses: hecrj/setup-rust-action@master with: @@ -35,10 +38,15 @@ jobs: os: [ubuntu-latest] rust: [beta] + env: + RUSTFLAGS: "-D warnings" + steps: - uses: hecrj/setup-rust-action@master with: rust-version: ${{ matrix.rust }} + - name: Install rustfmt + run: rustup component add rustfmt - uses: actions/checkout@master - name: Run tests run: cargo test --all --all-features @@ -50,6 +58,9 @@ jobs: os: [ubuntu-latest, macOS-latest] rust: [beta] + env: + RUSTFLAGS: "-D warnings" + steps: - uses: hecrj/setup-rust-action@master with: From 844a07ccd76bdbfcda79f2d696c08f2f565d461e Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 1 Oct 2019 19:07:41 -0400 Subject: [PATCH 5/5] Fix unused mut --- tonic-examples/src/routeguide/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic-examples/src/routeguide/server.rs b/tonic-examples/src/routeguide/server.rs index b7a0c302f..4c565623d 100644 --- a/tonic-examples/src/routeguide/server.rs +++ b/tonic-examples/src/routeguide/server.rs @@ -124,7 +124,7 @@ impl server::RouteGuide for RouteGuide { println!("RouteChat"); let stream = request.into_inner(); - let mut state = self.state.clone(); + let state = self.state.clone(); let output = async_stream::try_stream! { futures::pin_mut!(stream);