- Implemented PanicTracker to log panics using tracing within a dedicated span. - Introduced PanicInfo struct to capture panic details. - Added tests for panic catching and hook restoration. feat: implement token-bucket rate limiter - Created RateLimiter to manage token consumption with configurable rates and burst capacity. - Added methods for acquiring tokens and checking available tokens. - Included tests for rate limiting behavior and token availability. feat: add automatic retry with exponential backoff - Developed retry function to handle transient errors with configurable retry strategies. - Introduced RetryConfig for customizing retry behavior and jitter. - Added tests for various retry scenarios and error handling. feat: implement graceful shutdown coordination - Created ShutdownManager to manage shutdown signals and task completion. - Introduced ShutdownSignal for tasks to observe shutdown requests. - Added tests for shutdown request handling and task draining. feat: add timeout functionality for async operations - Implemented with_timeout function to enforce execution time limits on futures. - Created Timeout struct for wrapping futures with a deadline. - Added tests for timeout behavior and error mapping.
127 lines
4.3 KiB
YAML
127 lines
4.3 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 (workspace, all features)
|
|
run: cargo clippy --workspace --all-features -- -D warnings
|
|
- name: Clippy (workspace, no default features)
|
|
run: cargo clippy --workspace --no-default-features -- -D warnings
|
|
|
|
test-matrix:
|
|
name: Test (${{ matrix.name }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Whole-workspace sanity passes.
|
|
- name: workspace default features
|
|
flags: "--workspace"
|
|
- name: workspace all features
|
|
flags: "--workspace --all-features"
|
|
# mytheclipse: execution primitives + resiliency/traffic/lifecycle/observability
|
|
- name: mytheclipse / io only
|
|
flags: "-p mytheclipse --no-default-features --features io"
|
|
- name: mytheclipse / compute only
|
|
flags: "-p mytheclipse --no-default-features --features compute"
|
|
- name: mytheclipse / bg only
|
|
flags: "-p mytheclipse --no-default-features --features bg"
|
|
- name: mytheclipse / resiliency only
|
|
flags: "-p mytheclipse --no-default-features --features resiliency"
|
|
- name: mytheclipse / traffic only
|
|
flags: "-p mytheclipse --no-default-features --features traffic"
|
|
- name: mytheclipse / lifecycle only
|
|
flags: "-p mytheclipse --no-default-features --features lifecycle"
|
|
- name: mytheclipse / observability only
|
|
flags: "-p mytheclipse --no-default-features --features observability"
|
|
# corex-cache
|
|
- name: corex-cache / default
|
|
flags: "-p corex-cache"
|
|
- name: corex-cache / l1-moka
|
|
flags: "-p corex-cache --no-default-features --features l1-moka"
|
|
- name: corex-cache / l2-redis
|
|
flags: "-p corex-cache --no-default-features --features l1-memory,l2-redis"
|
|
# corex-storage
|
|
- name: corex-storage / default (local)
|
|
flags: "-p corex-storage"
|
|
- name: corex-storage / s3
|
|
flags: "-p corex-storage --no-default-features --features s3"
|
|
- name: corex-storage / gcs
|
|
flags: "-p corex-storage --no-default-features --features gcs"
|
|
# corex-event
|
|
- name: corex-event / default (mem)
|
|
flags: "-p corex-event"
|
|
- name: corex-event / amqp
|
|
flags: "-p corex-event --no-default-features --features amqp"
|
|
- name: corex-event / nats
|
|
flags: "-p corex-event --no-default-features --features nats"
|
|
# corex-config
|
|
- name: corex-config / default
|
|
flags: "-p corex-config"
|
|
# corex-crypto
|
|
- name: corex-crypto / default
|
|
flags: "-p corex-crypto"
|
|
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 mytheclipse example
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo run -p mytheclipse --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 --workspace --all-features --no-deps
|
|
|
|
package:
|
|
name: Cargo package dry-run
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
crate:
|
|
[mytheclipse, corex-cache, corex-storage, corex-event, corex-config, corex-crypto]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Package
|
|
run: cargo package -p ${{ matrix.crate }} --no-verify
|