Merge pull request #17 from irlserver/feat/librist-mr375-followups #160
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Check compilation | |
| run: cargo check | |
| - name: Check compilation without test features | |
| run: cargo check --release | |
| - name: Run unit tests | |
| run: cargo test --lib --verbose | |
| - name: Run unit tests with test-internals (verify encapsulation) | |
| run: cargo test --lib --features test-internals --verbose | |
| - name: Run all tests | |
| run: cargo test --features test-internals --verbose | |
| - name: Run tests with all features | |
| run: cargo test --all-features --verbose | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| - name: Install cargo-deny | |
| run: cargo install cargo-deny | |
| - name: Run supply-chain checks (advisories + sources) | |
| run: cargo deny check advisories sources | |
| # Miri lane over the only unsafe FFI in the tree: the recvmmsg batch-receive | |
| # path in src/connection/batch_recv.rs. Miri interprets the pure pointer logic | |
| # (self-referential iovec/mmsghdr setup, msg_len -> MTU clamp, sockaddr_storage | |
| # decode) and fails the PR on any UB regression there. Hard limit: miri cannot | |
| # execute the real recvmmsg syscall, so the live-syscall path is not covered. | |
| # The `batch_recv` filter scopes the run to that module's pure tests; the | |
| # mimalloc test allocator is cfg'd out under miri (C FFI miri cannot run). | |
| miri: | |
| name: Miri (batch_recv unsafe pointer logic) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: miri | |
| - name: Run batch_recv tests under miri | |
| run: cargo miri test --lib batch_recv | |
| test-stable: | |
| name: Test (Rust stable) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Run tests | |
| run: cargo test --features test-internals | |
| test-beta: | |
| name: Test (Rust beta) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: beta | |
| - name: Run tests | |
| run: cargo test | |
| test-windows: | |
| name: Test (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Run tests | |
| run: cargo test --features test-internals --verbose | |
| test-macos: | |
| name: Test (macOS) | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Run tests | |
| run: cargo test --verbose |