From a7375b687658790122c72e27e476affdd7bc1cb6 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 22 Jan 2024 02:19:19 +0000 Subject: [PATCH] ci: faster cargo-public-api install (#3255) --- .github/workflows/lint.yml | 22 ++++++++++++++-------- actix-http/src/requests/head.rs | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5d427aa90..adcb257b5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,12 +17,13 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 + - name: Install Rust (nightly) + uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 with: toolchain: nightly components: rustfmt - - name: Check with rustfmt + - name: Check with Rustfmt run: cargo fmt --all -- --check clippy: @@ -53,7 +54,8 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 + - name: Install Rust (nightly) + uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 with: toolchain: nightly components: rust-docs @@ -66,21 +68,25 @@ jobs: public-api-diff: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout main branch + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} - - uses: actions/checkout@v4 + - name: Checkout PR branch + uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 with: toolchain: nightly-2023-08-25 - - uses: taiki-e/cache-cargo-install-action@v1.3.0 + - name: Install cargo-public-api + uses: taiki-e/install-action@v2.24.1 with: tool: cargo-public-api - - name: generate API diff + - name: Generate API diff run: | for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do cargo public-api --manifest-path "$f" diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }} diff --git a/actix-http/src/requests/head.rs b/actix-http/src/requests/head.rs index 2e0c2dbd4..9ceb2a20c 100644 --- a/actix-http/src/requests/head.rs +++ b/actix-http/src/requests/head.rs @@ -17,7 +17,7 @@ pub struct RequestHead { pub version: Version, pub headers: HeaderMap, - /// Will only be None when called in unit tests unless [`TestRequest::peer_addr`] is used. + /// Will only be None when called in unit tests unless set manually. pub peer_addr: Option, flags: Flags,