Merge pull request #17 from cawalch/ps/rr/experiment__prefilter_config #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # Code formatting check | |
| format: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| # Linting with Clippy | |
| clippy: | |
| name: Clippy Linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-clippy- | |
| ${{ runner.os }}-cargo- | |
| - name: Run Clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| # Unit and integration tests | |
| test: | |
| name: Test Suite | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| rust: [stable, beta] | |
| exclude: | |
| # Reduce CI load by testing beta only on Ubuntu | |
| - os: windows-latest | |
| rust: beta | |
| - os: macos-latest | |
| rust: beta | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.rust }}-cargo-test- | |
| ${{ runner.os }}-${{ matrix.rust }}-cargo- | |
| ${{ runner.os }}-cargo- | |
| - name: Run tests | |
| run: cargo test --all-features --verbose | |
| - name: Run doc tests | |
| run: cargo test --doc | |
| # Code coverage analysis | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-coverage- | |
| ${{ runner.os }}-cargo- | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Run coverage analysis | |
| run: | | |
| cargo tarpaulin \ | |
| --ignore-tests \ | |
| --out Xml \ | |
| --out Json \ | |
| --output-dir target/coverage \ | |
| --exclude-files "examples/*" \ | |
| --exclude-files "benches/*" \ | |
| --exclude-files "tests/*" \ | |
| --timeout 120 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: target/coverage/cobertura.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| - name: Check coverage threshold | |
| run: | | |
| # Extract coverage percentage and check if it meets our 95% target | |
| COVERAGE=$(grep -o '"coverage":[0-9.]*' target/coverage/tarpaulin-report.json | cut -d: -f2 | head -1) | |
| echo "Current coverage: ${COVERAGE}%" | |
| # Convert to integer for comparison | |
| COVERAGE_INT=$(echo "$COVERAGE" | cut -d. -f1) | |
| if [ "$COVERAGE_INT" -lt 70 ]; then | |
| echo "❌ Coverage is below 70% threshold" | |
| exit 1 | |
| else | |
| echo "✅ Coverage meets 70% target" | |
| fi | |
| # Benchmark performance regression check | |
| benchmark: | |
| name: Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-bench- | |
| ${{ runner.os }}-cargo- | |
| - name: Run benchmarks | |
| run: | | |
| # Run a quick benchmark to ensure no major performance regressions | |
| cargo bench --bench vm_execution -- --output-format json > benchmark_results.json || true | |
| # Basic smoke test - just ensure benchmarks compile and run | |
| echo "✅ Benchmarks completed successfully" | |
| # Security audit | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| # Documentation build check | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-docs- | |
| ${{ runner.os }}-cargo- | |
| - name: Build documentation | |
| run: cargo doc --all-features --no-deps | |
| - name: Check for broken links in docs | |
| run: cargo doc --all-features --no-deps 2>&1 | grep -i "warning\|error" && exit 1 || echo "✅ Documentation built successfully" |