feat: SNMP support #76
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: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - features: "" | |
| name: default | |
| - features: ttl-nix | |
| name: ttl-nix | |
| - features: ttl-pnet | |
| name: ttl-pnet | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: clippy-${{ matrix.name }} | |
| - name: Clippy (${{ matrix.name }}) | |
| run: | | |
| if [ -n "${{ matrix.features }}" ]; then | |
| cargo clippy --all --tests --features ${{ matrix.features }} -- -D warnings | |
| else | |
| cargo clippy --all --tests -- -D warnings | |
| fi | |
| shell: bash | |
| test: | |
| name: Test (${{ matrix.os }}, ${{ matrix.rust }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| rust: stable | |
| features: --all-features | |
| - os: ubuntu-latest | |
| rust: beta | |
| features: --all-features | |
| - os: macos-latest | |
| rust: stable | |
| features: "" | |
| - os: windows-latest | |
| rust: stable | |
| features: "" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: test-${{ matrix.os }}-${{ matrix.rust }} | |
| - name: Install Npcap SDK (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP/npcap-sdk.zip" | |
| Expand-Archive -Path "$env:TEMP/npcap-sdk.zip" -DestinationPath "C:/npcap-sdk" | |
| echo "LIB=C:/npcap-sdk/Lib/x64" >> $env:GITHUB_ENV | |
| - name: Run tests | |
| run: cargo test --verbose ${{ matrix.features }} | |
| test-features: | |
| name: Test Features | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - features: "" | |
| name: default | |
| - features: ttl-nix | |
| name: ttl-nix | |
| - features: ttl-pnet | |
| name: ttl-pnet | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: test-features-${{ matrix.name }} | |
| - name: Test (${{ matrix.name }}) | |
| run: | | |
| if [ -n "${{ matrix.features }}" ]; then | |
| cargo test --verbose --features ${{ matrix.features }} | |
| else | |
| cargo test --verbose | |
| fi | |
| shell: bash | |
| build-release: | |
| name: Build Release (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: release-${{ matrix.target }} | |
| - name: Install Npcap SDK (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP/npcap-sdk.zip" | |
| Expand-Archive -Path "$env:TEMP/npcap-sdk.zip" -DestinationPath "C:/npcap-sdk" | |
| echo "LIB=C:/npcap-sdk/Lib/x64" >> $env:GITHUB_ENV | |
| - name: Build release | |
| run: cargo build --release --target ${{ matrix.target }} | |
| msrv: | |
| name: MSRV Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.93.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: msrv | |
| - name: Check MSRV | |
| run: cargo check --all-features | |
| doc: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: doc | |
| - name: Build documentation | |
| run: cargo doc --no-deps --all-features | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: rustsec/audit-check@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} |