Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
GreeFine committed Sep 1, 2023
2 parents 9da8d57 + 75386f4 commit 87ec5b4
Show file tree
Hide file tree
Showing 49 changed files with 518 additions and 397 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/ci-post-merge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: CI (post-merge)

on:
push:
branches: [master]
push: { branches: [master] }

permissions: { contents: read }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_test_linux_nightly:
Expand All @@ -27,39 +32,26 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install ${{ matrix.version }}
uses: actions-rs/toolchain@v1
- name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
profile: minimal
override: true
toolchain: ${{ matrix.version }}

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack

- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }

- name: check minimal
uses: actions-rs/cargo@v1
with: { command: ci-min }
run: cargo ci-min

- name: check minimal + examples
uses: actions-rs/cargo@v1
with: { command: ci-check-min-examples }
run: cargo ci-check-min-examples

- name: check default
uses: actions-rs/cargo@v1
with: { command: ci-check }
run: cargo ci-check

- name: tests
uses: actions-rs/cargo@v1
timeout-minutes: 40
with: { command: ci-test }
run: cargo ci-test

- name: Clear the cargo caches
run: |
Expand All @@ -86,18 +78,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install ${{ matrix.version }}
run: |
rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}

- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }

- name: check minimal
run: cargo ci-min
Expand Down
64 changes: 32 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]
pull_request: {}
push: { branches: [master] }

permissions: { contents: read }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_test_linux:
Expand All @@ -14,7 +18,7 @@ jobs:
target:
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
version:
- 1.59 # MSRV
- '1.60' # MSRV
- stable

name: ${{ matrix.target.name }} / ${{ matrix.version }}
Expand All @@ -35,18 +39,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install ${{ matrix.version }}
run: |
rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }

- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- name: workaround MSRV issues
if: matrix.version != 'stable'
run: |
cargo update -p=time:0.3.20 --precise=0.3.16
- name: check minimal
run: cargo ci-min
Expand Down Expand Up @@ -78,7 +83,7 @@ jobs:
triple: x86_64-pc-windows-msvc,
}
version:
- 1.59 # MSRV
- '1.60' # MSRV
- stable

name: ${{ matrix.target.name }} / ${{ matrix.version }}
Expand All @@ -87,18 +92,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install ${{ matrix.version }}
run: |
rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
- name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.version }}

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-hack }

- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- name: workaround MSRV issues
if: matrix.version != 'stable'
run: |
cargo update -p=time:0.3.20 --precise=0.3.16
- name: check minimal
run: cargo ci-min
Expand All @@ -125,14 +131,8 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust (nightly)
run: |
rustup install nightly
rustup override set nightly
- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }

- name: doc tests
timeout-minutes: 40
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# disabled because `cargo tarpaulin` currently segfaults

name: Coverage

on:
push:
branches: [master]
push: { branches: [master] }

permissions: { contents: read }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
coverage:
Expand All @@ -20,20 +23,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install stable
run: |
rustup override set stable
rustup update stable
- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.1.0
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }

- name: Generate coverage file
run: |
cargo install cargo-tarpaulin --vers "^0.13"
cargo tarpaulin --workspace --out Xml --verbose
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with: { file: cobertura.xml }
55 changes: 43 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]
on: [pull_request]

permissions: { contents: read }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
run: |
rustup override set nightly
rustup update nightly
rustup component add rustfmt
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt

- name: Check with rustfmt
run: cargo fmt --all -- --check

Expand All @@ -24,9 +29,35 @@ jobs:
- uses: actions/checkout@v3

- name: Install Rust
run: |
rustup override set stable
rustup update stable
rustup component add rustfmt
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { components: clippy }

- name: Check with Clippy
run: cargo clippy --workspace --tests --all-features

public-api-diff:
runs-on: ubuntu-latest
steps:
- name: checkout ${{ github.base_ref }}
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}

- name: checkout ${{ github.head_ref }}
uses: actions/checkout@v3

- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }

- name: Install cargo-public-api
uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-public-api }

- name: generate API diff
run: |
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
cargo public-api --manifest-path "$f" --all-features diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }} >> /tmp/diff.txt
done
cat /tmp/diff.txt
16 changes: 10 additions & 6 deletions .github/workflows/upload-doc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Upload Documentation

on:
push:
branches: [master]
push: { branches: [master] }

permissions: { contents: write }

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -11,10 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Rust
run: |
rustup override set nightly
rustup update nightly
- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }

- name: Build Docs
run: cargo doc --workspace --all-features --no-deps
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ members = [
"actix-web-httpauth",
]

# TODO(MSRV 1.64)
# [workspace.package]
# edition = "2018"
# rust-version = "1.60"

[patch.crates-io]
actix-cors = { path = "./actix-cors" }
actix-identity = { path = "./actix-identity" }
Expand Down
Loading

0 comments on commit 87ec5b4

Please sign in to comment.