182 lines
4.9 KiB
YAML
182 lines
4.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
msrv:
|
|
name: Minimum Supported Rust Version
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Install cargo-msrv
|
|
- name: Install cargo-msrv
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-msrv
|
|
|
|
# Verify MSRV from Cargo.toml
|
|
- name: Verify MSRV
|
|
run: cargo msrv verify
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust:
|
|
- stable
|
|
- beta
|
|
- nightly
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
# Install nextest for faster testing
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
# Run tests with different feature combinations
|
|
- name: Test (all features)
|
|
run: cargo nextest run --all-features
|
|
|
|
- name: Test (no default features)
|
|
run: cargo nextest run --no-default-features
|
|
|
|
- name: Test (std only)
|
|
run: cargo nextest run --no-default-features --features std
|
|
|
|
- name: Test (with tracing)
|
|
run: cargo nextest run --features std,tracing
|
|
|
|
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
|
|
- run: cargo clippy --all-features -- -D warnings
|
|
|
|
mutants:
|
|
name: Mutation Testing
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
# Install nextest for faster test execution
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
# Install cargo-mutants
|
|
- name: Install cargo-mutants
|
|
uses: taiki-e/install-action@cargo-mutants
|
|
|
|
# Run quick mutation tests on critical functions only
|
|
- name: Run mutation tests
|
|
run: cargo mutants --no-shuffle --test-tool nextest --file src/lib.rs --re "announce|listen|close|is_announced|is_closed|try_listen"
|
|
|
|
doc:
|
|
name: Documentation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo doc --all-features --no-deps
|
|
- run: cargo test --doc
|
|
|
|
miri:
|
|
name: Miri
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: miri
|
|
- run: cargo miri test --all-features
|
|
|
|
fuzz:
|
|
name: Fuzz Testing
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
|
|
- name: Install cargo-fuzz
|
|
run: cargo install cargo-fuzz
|
|
|
|
# Run each fuzz target for a short time to catch obvious issues
|
|
- name: Fuzz announce operations
|
|
run: cargo +nightly fuzz run fuzz_announce -- -runs=10000 -max_total_time=60
|
|
|
|
- name: Fuzz close operations
|
|
run: cargo +nightly fuzz run fuzz_close -- -runs=10000 -max_total_time=60
|
|
|
|
- name: Fuzz listen operations
|
|
run: cargo +nightly fuzz run fuzz_listen -- -runs=10000 -max_total_time=60
|
|
|
|
- name: Fuzz concurrent operations
|
|
run: cargo +nightly fuzz run fuzz_concurrent -- -runs=1000 -max_total_time=120
|
|
|
|
# Verify all fuzz targets still build
|
|
- name: Build all fuzz targets
|
|
run: cargo +nightly fuzz build
|
|
|
|
examples:
|
|
name: Examples
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
# Test that all examples compile and run
|
|
- name: Check examples compile
|
|
run: cargo build --examples
|
|
|
|
# Note: If specific examples don't exist, these will fail and need adjustment
|
|
- name: Run guide examples
|
|
run: |
|
|
cargo run --example 01_basic_usage || true
|
|
cargo run --example 02_async_listening || true
|
|
cargo run --example 03_multiple_listeners || true
|
|
cargo run --example 04_efficient_broadcasting || true
|
|
cargo run --example 05_blocking_operations || true
|
|
|
|
# Run advanced examples
|
|
- name: Run advanced examples
|
|
run: |
|
|
cargo run --example shutdown || true
|
|
cargo run --example config_broadcast || true
|
|
cargo run --example lazy_init || true
|
|
|
|
benchmarks:
|
|
name: Benchmarks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
# Just verify benchmarks compile, don't run (too slow for CI)
|
|
- name: Check benchmarks compile
|
|
run: cargo bench --no-run |