From 2803fcbe229203326007d31490e3ba87499425f6 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Thu, 2 Jan 2020 19:45:17 -0700 Subject: [PATCH 1/3] Small grammaritical update to lib.rs (#1248) --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a9965229c..d51005cfe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,7 @@ //! configure servers. //! //! * [web](web/index.html): This module -//! provide essentials helper functions and types for application registration. +//! provides essential helper functions and types for application registration. //! //! * [HttpRequest](struct.HttpRequest.html) and //! [HttpResponse](struct.HttpResponse.html): These structs From f5fd6bc49fd0886cf4a1c76de44c259aff7426c9 Mon Sep 17 00:00:00 2001 From: linkmauve Date: Mon, 6 Jan 2020 16:15:04 +0100 Subject: [PATCH 2/3] Fix actix-http examples (#1259) Fix actix-http examples --- actix-http/examples/echo.rs | 4 +++- actix-http/examples/echo2.rs | 4 +++- actix-http/examples/hello-world.rs | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/actix-http/examples/echo.rs b/actix-http/examples/echo.rs index 5b2894f89..3d57a472a 100644 --- a/actix-http/examples/echo.rs +++ b/actix-http/examples/echo.rs @@ -7,7 +7,8 @@ use futures::StreamExt; use http::header::HeaderValue; use log::info; -fn main() -> io::Result<()> { +#[actix_rt::main] +async fn main() -> io::Result<()> { env::set_var("RUST_LOG", "echo=info"); env_logger::init(); @@ -37,4 +38,5 @@ fn main() -> io::Result<()> { .tcp() })? .run() + .await } diff --git a/actix-http/examples/echo2.rs b/actix-http/examples/echo2.rs index 07d181277..f89ea2dfb 100644 --- a/actix-http/examples/echo2.rs +++ b/actix-http/examples/echo2.rs @@ -19,7 +19,8 @@ async fn handle_request(mut req: Request) -> Result { .body(body)) } -fn main() -> io::Result<()> { +#[actix_rt::main] +async fn main() -> io::Result<()> { env::set_var("RUST_LOG", "echo=info"); env_logger::init(); @@ -28,4 +29,5 @@ fn main() -> io::Result<()> { HttpService::build().finish(handle_request).tcp() })? .run() + .await } diff --git a/actix-http/examples/hello-world.rs b/actix-http/examples/hello-world.rs index 7d8576869..4134ee734 100644 --- a/actix-http/examples/hello-world.rs +++ b/actix-http/examples/hello-world.rs @@ -6,7 +6,8 @@ use futures::future; use http::header::HeaderValue; use log::info; -fn main() -> io::Result<()> { +#[actix_rt::main] +async fn main() -> io::Result<()> { env::set_var("RUST_LOG", "hello_world=info"); env_logger::init(); @@ -24,4 +25,5 @@ fn main() -> io::Result<()> { .tcp() })? .run() + .await } From 51ab4fb73dd1fce8de44184d08cc916c060a4d41 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 10 Jan 2020 03:30:45 +0900 Subject: [PATCH 3/3] Tweak actions to use cache and not to be stuck on the way (#1264) --- .github/workflows/macos.yml | 59 ++++++++++++++++++++++++++ .github/workflows/main.yml | 67 ----------------------------- .github/workflows/windows.yml | 79 +++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..f50ae2f05 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,59 @@ +name: CI (macOS) + +on: [push, pull_request] + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-apple-darwin + runs-on: macOS-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-apple-darwin + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: update + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-build-${{ hashFiles('**/Cargo.lock') }} + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture + --skip=test_h2_content_length + --skip=test_reading_deflate_encoding_large_random_rustls diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 693291fd3..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: CI - -on: [push, pull_request] - -env: - VCPKGRS_DYNAMIC: 1 - -jobs: - build_and_test: - strategy: - fail-fast: false - matrix: - toolchain: - - x86_64-pc-windows-msvc - # - i686-pc-windows-msvc - - x86_64-apple-darwin - version: - - stable - - nightly - include: - - toolchain: x86_64-pc-windows-msvc - os: windows-latest - arch: x64 - # - toolchain: i686-pc-windows-msvc - # os: windows-latest - # arch: x86 - - toolchain: x86_64-apple-darwin - os: macOS-latest - - name: ${{ matrix.version }} - ${{ matrix.toolchain }} - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@master - - - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.version }}-${{ matrix.toolchain }} - default: true - - - name: Install OpenSSL - if: matrix.os == 'windows-latest' - run: | - vcpkg integrate install - vcpkg install openssl:${{ matrix.arch }}-windows - - - name: check nightly - if: matrix.version == 'nightly' - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --benches --bins --examples --tests - - - name: check stable - if: matrix.version == 'stable' - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --bins --examples --tests - - - name: tests - if: matrix.toolchain != 'x86_64-pc-windows-gnu' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --all-features -- --nocapture diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..9aa3d3ba4 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,79 @@ +name: CI (Windows) + +on: [push, pull_request] + +env: + VCPKGRS_DYNAMIC: 1 + +jobs: + build_and_test: + strategy: + fail-fast: false + matrix: + version: + - stable + - nightly + + name: ${{ matrix.version }} - x86_64-pc-windows-msvc + runs-on: windows-latest + + steps: + - uses: actions/checkout@master + + - name: Install ${{ matrix.version }} + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.version }}-x86_64-pc-windows-msvc + profile: minimal + override: true + + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: update + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ matrix.version }}-x86_64-pc-windows-msvc-cargo-build-${{ hashFiles('**/Cargo.lock') }} + - name: Cache vcpkg package + uses: actions/cache@v1 + id: cache-vcpkg + with: + path: C:\vcpkg + key: windows_x64-${{ matrix.version }}-vcpkg + + - name: Install OpenSSL + if: steps.cache-vcpkg.outputs.cache-hit != 'true' + run: | + vcpkg integrate install + vcpkg install openssl:x64-windows + + - name: check build + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --bins --examples --tests + + - name: tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all --all-features --no-fail-fast -- --nocapture + --skip=test_h2_content_length + --skip=test_reading_deflate_encoding_large_random_rustls + --skip=test_params + --skip=test_simple + --skip=test_expect_continue + --skip=test_http10_keepalive + --skip=test_slow_request