- Implemented PanicTracker for logging panics using tracing. - Introduced PanicInfo struct to capture panic details. - Added tests for panic catching and hook restoration. feat: implement token-bucket rate limiter - Created RateLimiter for controlling token consumption with burst capacity. - Added methods for acquiring tokens and checking available tokens. - Included tests for rate limiting behavior and error handling. feat: add automatic retry with exponential backoff - Developed retry function to handle transient errors with configurable retry logic. - Introduced RetryConfig for customizing retry parameters. - Added tests for various retry scenarios and error handling. feat: implement graceful shutdown coordination - Created ShutdownManager to handle OS signals and manage task shutdown. - Introduced ShutdownSignal for tasks to observe shutdown requests. - Added tests for shutdown behavior and task management. feat: add timeout functionality for async operations - Implemented with_timeout function to enforce execution time limits. - Created Timeout struct for wrapping futures with deadlines. - Added tests for timeout behavior and error handling.
92 lines
2.5 KiB
YAML
92 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- name: Clippy (all features)
|
|
run: cargo clippy --all-features -- -D warnings
|
|
- name: Clippy (no default features)
|
|
run: cargo clippy --no-default-features -- -D warnings
|
|
|
|
test-matrix:
|
|
name: Test (${{ matrix.name }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: default features
|
|
flags: ""
|
|
- name: all features
|
|
flags: "--all-features"
|
|
- name: io only
|
|
flags: "--no-default-features --features io"
|
|
- name: compute only
|
|
flags: "--no-default-features --features compute"
|
|
- name: bg only
|
|
flags: "--no-default-features --features bg"
|
|
- name: resiliency only
|
|
flags: "--no-default-features --features resiliency"
|
|
- name: traffic only
|
|
flags: "--no-default-features --features traffic"
|
|
- name: lifecycle only
|
|
flags: "--no-default-features --features lifecycle"
|
|
- name: observability only
|
|
flags: "--no-default-features --features observability"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Build
|
|
run: cargo build --all-targets ${{ matrix.flags }}
|
|
- name: Test
|
|
run: cargo test ${{ matrix.flags }}
|
|
|
|
example:
|
|
name: Run example
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo run --example main --features full
|
|
|
|
docs:
|
|
name: Docs check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps
|
|
|
|
package:
|
|
name: Cargo package dry-run
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Package
|
|
run: cargo package --no-verify |