From cfb24bbb4ec4d669b2c56c5abd332089b86e63d1 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Mon, 13 Oct 2025 19:48:02 -0600 Subject: [PATCH] fix: fix CI config, update MSRV to 1.80.1 --- .github/workflows/ci.yml | 148 ++++++++++++++++++++++----------- .github/workflows/coverage.yml | 24 ------ .github/workflows/security.yml | 19 ----- Cargo.toml | 4 +- justfile | 12 ++- 5 files changed, 112 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/coverage.yml delete mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b922cd3..b6bfb6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,29 +5,16 @@ on: branches: [ main ] pull_request: branches: [ main ] + schedule: + - cron: '0 0 * * 0' # Weekly security audit 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 + # Comprehensive testing on Linux (stable, beta, nightly) + test-linux: + name: Test (${{ matrix.rust }}, Linux) runs-on: ubuntu-latest strategy: matrix: @@ -41,11 +28,9 @@ jobs: 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 @@ -58,6 +43,25 @@ jobs: - 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 @@ -78,25 +82,20 @@ jobs: components: clippy - run: cargo clippy --all-features -- -D warnings - mutants: - name: Mutation Testing + # MSRV verification + msrv: + name: MSRV 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" + - 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 @@ -106,16 +105,61 @@ jobs: - run: cargo doc --all-features --no-deps - run: cargo test --doc - miri: - name: Miri + # Code coverage + coverage: + name: Coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly - with: - components: miri - - run: cargo miri test --all-features + - 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 @@ -126,7 +170,6 @@ jobs: - 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 @@ -139,10 +182,10 @@ jobs: - 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 verification examples: name: Examples runs-on: ubuntu-latest @@ -150,11 +193,9 @@ jobs: - 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 @@ -163,13 +204,13 @@ jobs: 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 (just verify they compile) benchmarks: name: Benchmarks runs-on: ubuntu-latest @@ -177,6 +218,17 @@ jobs: - 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 \ No newline at end of file + 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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 17c7e9e..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml deleted file mode 100644 index 1b46aad..0000000 --- a/.github/workflows/security.yml +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 2269c47..8924074 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,10 @@ name = "announcement" version = "0.1.0" edition = "2021" -rust-version = "1.80" +rust-version = "1.80.1" authors = ["Stephen Waits "] license = "MIT" -description = "A runtime-agnostic oneshot broadcast channel for Rust" +description = "A runtime-agnostic oneshot broadcast channel" repository = "https://github.com/swaits/announcement" documentation = "https://docs.rs/announcement" keywords = ["async", "channel", "broadcast", "oneshot", "sync"] diff --git a/justfile b/justfile index 532141d..7ed263e 100644 --- a/justfile +++ b/justfile @@ -78,7 +78,7 @@ pre-push: check test coverage @echo "✅ Pre-push checks passed - safe to push!" # 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 set -e @@ -105,11 +105,13 @@ pre-release: check test coverage audit mutants echo "" echo "✅ All pre-release checks passed!" echo " - Code formatted and linted" - echo " - All tests passing (507+ tests)" + echo " - All tests passing" echo " - Code coverage ≥ {{coverage_target}}%" echo " - No security vulnerabilities" echo " - Dependencies verified" echo " - Mutation testing complete" + echo " - All examples run successfully" + echo " - All benchmarks compile" echo " - Documentation version verified" echo " - Package ready for publication" echo "" @@ -161,6 +163,12 @@ fuzz: # Benchmarks # ============================================================================= +# Verify benchmarks compile +bench-check: + @echo "Verifying benchmarks compile..." + cargo bench --no-run + @echo "✅ All benchmarks compile" + # Run all benchmarks bench: cargo bench