235 lines
6.1 KiB
YAML
235 lines
6.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
schedule:
|
|
- cron: '0 0 * * 0' # Weekly security audit
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
# Comprehensive testing on Linux (stable, beta, nightly)
|
|
test-linux:
|
|
name: Test (${{ matrix.rust }}, Linux)
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust:
|
|
- stable
|
|
- beta
|
|
- nightly
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
- 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
|
|
|
|
# Cross-platform smoke tests (basic test to catch platform-specific issues)
|
|
test-cross-platform:
|
|
name: Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
# Just run basic tests with all features
|
|
- name: Test (all features)
|
|
run: cargo nextest run --all-features
|
|
|
|
# Code quality checks
|
|
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
|
|
|
|
# MSRV verification
|
|
msrv:
|
|
name: MSRV
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install cargo-msrv
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-msrv
|
|
- name: Verify MSRV
|
|
run: cargo msrv verify
|
|
|
|
# Documentation
|
|
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
|
|
|
|
# Code coverage
|
|
coverage:
|
|
name: Coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install cargo-llvm-cov
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-llvm-cov
|
|
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
- name: Generate coverage
|
|
run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info
|
|
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
files: lcov.info
|
|
|
|
# Mutation testing
|
|
mutants:
|
|
name: Mutation Testing
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
- name: Install cargo-mutants
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-mutants
|
|
|
|
# Run mutation tests on critical functions only (faster CI)
|
|
- 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"
|
|
|
|
# Security audit
|
|
audit:
|
|
name: Security Audit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: rustsec/audit-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Fuzz testing (short runs to catch obvious issues)
|
|
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
|
|
|
|
- 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
|
|
|
|
- name: Build all fuzz targets
|
|
run: cargo +nightly fuzz build
|
|
|
|
# Examples verification
|
|
examples:
|
|
name: Examples
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Check examples compile
|
|
run: cargo build --examples
|
|
|
|
- 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
|
|
|
|
- name: Run advanced examples
|
|
run: |
|
|
cargo run --example shutdown || true
|
|
cargo run --example config_broadcast || true
|
|
cargo run --example lazy_init || true
|
|
|
|
# Benchmarks (just verify they compile)
|
|
benchmarks:
|
|
name: Benchmarks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Check benchmarks compile
|
|
run: cargo bench --no-run
|
|
|
|
# Optional: Miri (disabled by default - uncomment to enable)
|
|
# Very slow but thorough undefined behavior detection
|
|
# 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
|