1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-11 01:39:33 +00:00

Merge branch 'master' into scope_work

This commit is contained in:
Jon Lim 2023-09-13 21:59:45 -07:00
commit efe990dca5
8 changed files with 75 additions and 57 deletions

View file

@ -1,12 +1,10 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: "cargo" - package-ecosystem: cargo
directory: "/" directory: /
schedule: schedule:
interval: "monthly" interval: weekly
open-pull-requests-limit: 10 - package-ecosystem: github-actions
- package-ecosystem: "github-actions" directory: /
directory: "/"
schedule: schedule:
interval: "monthly" interval: daily
open-pull-requests-limit: 10

View file

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
run: | run: |

View file

@ -28,7 +28,7 @@ jobs:
runs-on: ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install OpenSSL - name: Install OpenSSL
if: matrix.target.os == 'windows-latest' if: matrix.target.os == 'windows-latest'
@ -40,12 +40,14 @@ jobs:
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Install Rust (${{ matrix.version.name }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version.version }} toolchain: ${{ matrix.version.version }}
- name: Install cargo-hack - name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack uses: taiki-e/install-action@v2.18.9
with:
tool: cargo-hack
- name: check minimal - name: check minimal
run: cargo ci-check-min run: cargo ci-check-min
@ -77,13 +79,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install cargo-hack - name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack uses: taiki-e/install-action@v2.18.9
with:
tool: cargo-hack
- name: check feature combinations - name: check feature combinations
run: cargo ci-check-all-feature-powerset run: cargo ci-check-all-feature-powerset
@ -96,13 +100,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
- name: Install nextest - name: Install nextest
uses: taiki-e/install-action@nextest uses: taiki-e/install-action@v2.18.9
with:
tool: nextest
- name: Test with cargo-nextest - name: Test with cargo-nextest
run: cargo nextest run run: cargo nextest run

View file

@ -33,7 +33,7 @@ jobs:
runs-on: ${{ matrix.target.os }} runs-on: ${{ matrix.target.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install OpenSSL - name: Install OpenSSL
if: matrix.target.os == 'windows-latest' if: matrix.target.os == 'windows-latest'
@ -45,18 +45,21 @@ jobs:
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Install Rust (${{ matrix.version.name }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: ${{ matrix.version.version }} toolchain: ${{ matrix.version.version }}
- name: Install cargo-hack - name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack uses: taiki-e/install-action@v2.18.9
with:
tool: cargo-hack
- name: workaround MSRV issues - name: workaround MSRV issues
if: matrix.version.name != 'stable' if: matrix.version.name == 'msrv'
run: | run: |
cargo update -p=clap --precise=4.3.24 cargo update -p=clap --precise=4.3.24
cargo update -p=clap_lex --precise=0.5.0 cargo update -p=clap_lex --precise=0.5.0
cargo update -p=anstyle --precise=1.0.2
- name: check minimal - name: check minimal
run: cargo ci-check-min run: cargo ci-check-min
@ -87,11 +90,12 @@ jobs:
name: io-uring tests name: io-uring tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { toolchain: nightly } with:
toolchain: nightly
- name: tests (io-uring) - name: tests (io-uring)
timeout-minutes: 60 timeout-minutes: 60
@ -102,11 +106,12 @@ jobs:
name: doc tests name: doc tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { toolchain: nightly } with:
toolchain: nightly
- name: doc tests - name: doc tests
run: cargo ci-doctest run: cargo ci-doctest

View file

@ -5,7 +5,7 @@ on:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
permissions: permissions:
contents: read # to fetch code (actions/checkout) contents: read
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@ -15,9 +15,9 @@ jobs:
fmt: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt components: rustfmt
@ -30,43 +30,49 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { components: clippy }
- uses: giraffate/clippy-action@v1
with: with:
reporter: 'github-pr-check' components: clippy
- uses: giraffate/clippy-action@v1.0.1
with:
reporter: github-pr-check
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo -Aunknown_lints clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo -Aunknown_lints
lint-docs: lint-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { components: rust-docs } with:
toolchain: nightly
components: rust-docs
- name: Check for broken intra-doc links - name: Check for broken intra-doc links
env: { RUSTDOCFLAGS: "-D warnings" } env:
run: cargo doc --no-deps --all-features --workspace RUSTDOCFLAGS: -D warnings
run: cargo +nightly doc --no-deps --workspace --all-features
public-api-diff: public-api-diff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
ref: ${{ github.base_ref }} ref: ${{ github.base_ref }}
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: { toolchain: nightly-2023-08-25 } with:
toolchain: nightly-2023-08-25
- uses: taiki-e/cache-cargo-install-action@v1 - uses: taiki-e/cache-cargo-install-action@v1.2.1
with: { tool: cargo-public-api } with:
tool: cargo-public-api
- name: generate API diff - name: generate API diff
run: | run: |

View file

@ -15,14 +15,15 @@ jobs:
coverage: coverage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0 uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with: with:
components: llvm-tools-preview components: llvm-tools-preview
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.13.4 uses: taiki-e/install-action@v2.18.9
with: with:
tool: cargo-llvm-cov tool: cargo-llvm-cov

View file

@ -5,8 +5,7 @@ on:
branches: [master] branches: [master]
permissions: permissions:
contents: read # to fetch code (actions/checkout) contents: read
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -14,14 +13,17 @@ concurrency:
jobs: jobs:
build: build:
permissions: permissions:
contents: write # to push changes in repo (jamesives/github-pages-deploy-action) contents: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: nightly
- name: Build Docs - name: Build Docs
run: cargo +nightly doc --no-deps --workspace --all-features run: cargo +nightly doc --no-deps --workspace --all-features

View file

@ -32,8 +32,8 @@ pub(crate) type FnDataFactory =
/// Since the Actix Web router layers application data, the returned object will reference the /// Since the Actix Web router layers application data, the returned object will reference the
/// "closest" instance of the type. For example, if an `App` stores a `u32`, a nested `Scope` /// "closest" instance of the type. For example, if an `App` stores a `u32`, a nested `Scope`
/// also stores a `u32`, and the delegated request handler falls within that `Scope`, then /// also stores a `u32`, and the delegated request handler falls within that `Scope`, then
/// extracting a `web::<Data<u32>>` for that handler will return the `Scope`'s instance. /// extracting a `web::Data<u32>` for that handler will return the `Scope`'s instance. However,
/// However, using the same router set up and a request that does not get captured by the `Scope`, /// using the same router set up and a request that does not get captured by the `Scope`,
/// `web::<Data<u32>>` would return the `App`'s instance. /// `web::<Data<u32>>` would return the `App`'s instance.
/// ///
/// If route data is not set for a handler, using `Data<T>` extractor would cause a `500 Internal /// If route data is not set for a handler, using `Data<T>` extractor would cause a `500 Internal