From a85839485503a611c0617c070c41682cd5356cc1 Mon Sep 17 00:00:00 2001 From: Pavlos-Petros Tournaris Date: Sun, 7 Apr 2024 20:42:16 +0300 Subject: [PATCH] Refresh GitHub workflows (#337) * Add .idea in .gitignore * Refresh Github workflows * Allow very complex type usage in ntex-rt --- .github/workflows/checks.yml | 27 +++++++------------ .github/workflows/cov.yml | 12 +++------ .github/workflows/linux.yml | 20 +++++--------- .github/workflows/osx.yml | 19 +++++-------- .github/workflows/windows.yml | 50 +++++++++++++++-------------------- .gitignore | 1 + ntex-rt/src/lib.rs | 1 + 7 files changed, 51 insertions(+), 79 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 964fcc3f..b0811d0f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -7,16 +7,12 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: stable - components: clippy - override: true - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + toolchain: stable + components: clippy + - run: cargo clippy --all-features fmt: name: Rustfmt @@ -26,13 +22,10 @@ jobs: rust: - stable steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + components: rustfmt + rustflags: --profile minimal + - run: cargo fmt --all -- --check diff --git a/.github/workflows/cov.yml b/.github/workflows/cov.yml index 8b8e3988..6be5c279 100644 --- a/.github/workflows/cov.yml +++ b/.github/workflows/cov.yml @@ -13,19 +13,15 @@ jobs: with: tool-cache: true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust run: rustup update nightly - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile - - - name: Cache Dependencies - uses: Swatinem/rust-cache@v1.0.1 + run: cargo generate-lockfile - name: Clean coverage results run: cargo llvm-cov clean --workspace @@ -40,7 +36,7 @@ jobs: run: cargo +nightly llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-tokio|ntex-glommio|ntex-async-std" - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: lcov.info fail_ci_if_error: true diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 53e0f2c2..a54d0398 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -21,38 +21,32 @@ jobs: with: tool-cache: true - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu - profile: minimal - override: true + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: Cache cargo registry - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.cargo/registry key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.cargo/git key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Run tests - uses: actions-rs/cargo@v1 timeout-minutes: 40 - with: - command: test - args: --all --all-features --no-fail-fast -- --nocapture + run: cargo test --all --all-features --no-fail-fast -- --nocapture - name: Run async-std tests timeout-minutes: 40 diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index d008e57a..c7307552 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -15,37 +15,30 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-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: generate-lockfile + run: cargo generate-lockfile - name: Cache cargo registry - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.cargo/registry key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.cargo/git key: ${{ matrix.version }}-x86_64-apple-darwin-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --all-features --no-fail-fast -- --nocapture + run: cargo test --all --all-features --no-fail-fast -- --nocapture - name: Clear the cargo caches run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a990fa92..f5ba5b4c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,19 +18,15 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Install ${{ matrix.version }} - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-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: generate-lockfile + run: cargo generate-lockfile - name: Cache vcpkg uses: actions/cache@v4 @@ -66,24 +62,22 @@ jobs: Get-ChildItem C:\vcpkg\installed\x64-windows\lib - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib --all-features --no-fail-fast -- --nocapture - --skip test_panic_in_worker - --skip test_connection_force_close - --skip test_connection_server_close - --skip test_freeze - --skip test_simple - --skip test_test_methods - --skip test_connection_wait_queue_force_close - --skip test_params - --skip test_body - --skip test_form - --skip test_json - --skip test_connection_reuse - --skip test_connection_wait_queue - --skip test_no_decompress - --skip test_connection_reuse_h2 - --skip test_h2_tcp - --skip test_timer + run: | + cargo test --lib --all-features --no-fail-fast -- --nocapture \ + --skip test_panic_in_worker \ + --skip test_connection_force_close \ + --skip test_connection_server_close \ + --skip test_freeze \ + --skip test_simple \ + --skip test_test_methods \ + --skip test_connection_wait_queue_force_close \ + --skip test_params \ + --skip test_body \ + --skip test_form \ + --skip test_json \ + --skip test_connection_reuse \ + --skip test_connection_wait_queue \ + --skip test_no_decompress \ + --skip test_connection_reuse_h2 \ + --skip test_h2_tcp \ + --skip test_timer diff --git a/.gitignore b/.gitignore index 2c5156f8..cf57a3c1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ cobertura.xml # These are backup files generated by rustfmt **/*.rs.bk +.idea/ diff --git a/ntex-rt/src/lib.rs b/ntex-rt/src/lib.rs index fd686073..18150d70 100644 --- a/ntex-rt/src/lib.rs +++ b/ntex-rt/src/lib.rs @@ -140,6 +140,7 @@ mod glommio { /// Blocking operation completion future. It resolves with results /// of blocking function execution. + #[allow(clippy::type_complexity)] pub struct JoinHandle { fut: Either, Pin>>>>,