fix: fix CI config, update MSRV to 1.80.1

This commit is contained in:
swaits committed 2025-10-13 19:58:08 -06:00
1 parent e8e55b7676
commit cfb24bbb4e
5 files changed
+111 -94

No files matched your search

+99 -47
View File
@@ -5,29 +5,16 @@ on:
branches: [ main ] branches: [ main ]
pull_request: pull_request:
branches: [ main ] branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Weekly security audit
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
jobs: jobs:
msrv: # Comprehensive testing on Linux (stable, beta, nightly)
name: Minimum Supported Rust Version test-linux:
runs-on: ubuntu-latest name: Test (${{ matrix.rust }}, Linux)
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 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@@ -41,11 +28,9 @@ jobs:
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
# Install nextest for faster testing
- name: Install nextest - name: Install nextest
uses: taiki-e/install-action@nextest uses: taiki-e/install-action@nextest
# Run tests with different feature combinations
- name: Test (all features) - name: Test (all features)
run: cargo nextest run --all-features run: cargo nextest run --all-features
@@ -58,6 +43,25 @@ jobs:
- name: Test (with tracing) - name: Test (with tracing)
run: cargo nextest run --features std,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: fmt:
name: Rustfmt name: Rustfmt
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -78,25 +82,20 @@ jobs:
components: clippy components: clippy
- run: cargo clippy --all-features -- -D warnings - run: cargo clippy --all-features -- -D warnings
mutants: # MSRV verification
name: Mutation Testing msrv:
name: MSRV
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - name: Install cargo-msrv
uses: taiki-e/install-action@v2
# Install nextest for faster test execution with:
- name: Install nextest tool: cargo-msrv
uses: taiki-e/install-action@nextest - name: Verify MSRV
run: cargo msrv verify
# 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"
# Documentation
doc: doc:
name: Documentation name: Documentation
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -106,16 +105,61 @@ jobs:
- run: cargo doc --all-features --no-deps - run: cargo doc --all-features --no-deps
- run: cargo test --doc - run: cargo test --doc
miri: # Code coverage
name: Miri coverage:
name: Coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/rust-toolchain@stable
with:
components: miri
- run: cargo miri test --all-features
- 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: fuzz:
name: Fuzz Testing name: Fuzz Testing
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -126,7 +170,6 @@ jobs:
- name: Install cargo-fuzz - name: Install cargo-fuzz
run: cargo install cargo-fuzz run: cargo install cargo-fuzz
# Run each fuzz target for a short time to catch obvious issues
- name: Fuzz announce operations - name: Fuzz announce operations
run: cargo +nightly fuzz run fuzz_announce -- -runs=10000 -max_total_time=60 run: cargo +nightly fuzz run fuzz_announce -- -runs=10000 -max_total_time=60
@@ -139,10 +182,10 @@ jobs:
- name: Fuzz concurrent operations - name: Fuzz concurrent operations
run: cargo +nightly fuzz run fuzz_concurrent -- -runs=1000 -max_total_time=120 run: cargo +nightly fuzz run fuzz_concurrent -- -runs=1000 -max_total_time=120
# Verify all fuzz targets still build
- name: Build all fuzz targets - name: Build all fuzz targets
run: cargo +nightly fuzz build run: cargo +nightly fuzz build
# Examples verification
examples: examples:
name: Examples name: Examples
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -150,11 +193,9 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
# Test that all examples compile and run
- name: Check examples compile - name: Check examples compile
run: cargo build --examples run: cargo build --examples
# Note: If specific examples don't exist, these will fail and need adjustment
- name: Run guide examples - name: Run guide examples
run: | run: |
cargo run --example 01_basic_usage || true cargo run --example 01_basic_usage || true
@@ -163,13 +204,13 @@ jobs:
cargo run --example 04_efficient_broadcasting || true cargo run --example 04_efficient_broadcasting || true
cargo run --example 05_blocking_operations || true cargo run --example 05_blocking_operations || true
# Run advanced examples
- name: Run advanced examples - name: Run advanced examples
run: | run: |
cargo run --example shutdown || true cargo run --example shutdown || true
cargo run --example config_broadcast || true cargo run --example config_broadcast || true
cargo run --example lazy_init || true cargo run --example lazy_init || true
# Benchmarks (just verify they compile)
benchmarks: benchmarks:
name: Benchmarks name: Benchmarks
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -177,6 +218,17 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
# Just verify benchmarks compile, don't run (too slow for CI)
- name: Check benchmarks compile - name: Check benchmarks compile
run: cargo bench --no-run 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
-24
View File
@@ -1,24 +0,0 @@
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install llvm-cov
run: cargo install cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload coverage
uses: codecov/codecov-action@v3
-19
View File
@@ -1,19 +0,0 @@
name: Security
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Weekly
jobs:
audit:
name: Cargo Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -2,10 +2,10 @@
name = "announcement" name = "announcement"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
rust-version = "1.80" rust-version = "1.80.1"
authors = ["Stephen Waits <steve@waits.net>"] authors = ["Stephen Waits <steve@waits.net>"]
license = "MIT" license = "MIT"
description = "A runtime-agnostic oneshot broadcast channel for Rust" description = "A runtime-agnostic oneshot broadcast channel"
repository = "https://github.com/swaits/announcement" repository = "https://github.com/swaits/announcement"
documentation = "https://docs.rs/announcement" documentation = "https://docs.rs/announcement"
keywords = ["async", "channel", "broadcast", "oneshot", "sync"] keywords = ["async", "channel", "broadcast", "oneshot", "sync"]
+10 -2
View File
@@ -78,7 +78,7 @@ pre-push: check test coverage
@echo "✅ Pre-push checks passed - safe to push!" @echo "✅ Pre-push checks passed - safe to push!"
# Comprehensive pre-release validation # Comprehensive pre-release validation
pre-release: check test coverage audit mutants pre-release: check test coverage audit mutants examples bench-check
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
@@ -105,11 +105,13 @@ pre-release: check test coverage audit mutants
echo "" echo ""
echo "✅ All pre-release checks passed!" echo "✅ All pre-release checks passed!"
echo " - Code formatted and linted" echo " - Code formatted and linted"
echo " - All tests passing (507+ tests)" echo " - All tests passing"
echo " - Code coverage ≥ {{coverage_target}}%" echo " - Code coverage ≥ {{coverage_target}}%"
echo " - No security vulnerabilities" echo " - No security vulnerabilities"
echo " - Dependencies verified" echo " - Dependencies verified"
echo " - Mutation testing complete" echo " - Mutation testing complete"
echo " - All examples run successfully"
echo " - All benchmarks compile"
echo " - Documentation version verified" echo " - Documentation version verified"
echo " - Package ready for publication" echo " - Package ready for publication"
echo "" echo ""
@@ -161,6 +163,12 @@ fuzz:
# Benchmarks # Benchmarks
# ============================================================================= # =============================================================================
# Verify benchmarks compile
bench-check:
@echo "Verifying benchmarks compile..."
cargo bench --no-run
@echo "✅ All benchmarks compile"
# Run all benchmarks # Run all benchmarks
bench: bench:
cargo bench cargo bench