simple-someip 0.7.3

A lightweight SOME/IP serialization and communication library
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  merge_group:

jobs:
  check:
    name: Format & Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --all --check
      - run: cargo clippy --workspace --all-features -- -D warnings -D clippy::pedantic
      - run: cargo clippy --no-default-features -- -D warnings -D clippy::pedantic

  linear-history:
    name: Linear PR History
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request'
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Check for merge commits
        run: |
          merge_commits=$(git rev-list --merges origin/main..HEAD)
          if [ -n "$merge_commits" ]; then
            echo "::error::PR branch contains merge commits. Please rebase instead."
            echo "$merge_commits"
            exit 1
          fi

  semver:
    name: SemVer Check
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: obi1kenobi/cargo-semver-checks-action@v2

  test:
    name: Build, Test & Coverage
    needs: check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools
      - uses: Swatinem/rust-cache@v2
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-llvm-cov, cargo-nextest
      - run: cargo test --no-default-features
      - run: cargo llvm-cov nextest --all-features --lcov --output-path ./target/lcov.info
      - name: Upload Coverage report
        uses: codecov/codecov-action@v5
        with:
          report_type: coverage
          files: ./target/lcov.info
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: true
      - name: Upload test results to Codecov
        uses: codecov/codecov-action@v5
        with:
          report_type: test_results
          files: ./target/nextest/default/junit.xml
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: true

  test-windows:
    name: Build & Test (Windows)
    # Cross-platform socket-bind coverage: the SD discovery path binds a
    # wildcard multicast socket alongside an interface-IP unicast socket and
    # relies on "most-specific bind wins" to divert unicast SD (see
    # `socket_manager::dual_socket_splits_multicast_from_unicast`). That divert
    # is the portability risk. No coverage/codecov here — purely the
    # OS-portability signal.
    #
    # Two steps:
    #  1. `--no-run` compiles everything (incl. the `tests/` integration suite)
    #     to prove the crate *builds* on Windows.
    #  2. `--lib` runs the library unit tests, which include the dual-socket
    #     divert assertion — the behavior we actually need to confirm on Windows.
    # The `tests/client_server.rs` integration suite is compiled but NOT run
    # here: it binds fixed SD ports and is flaky under parallel execution on
    # every platform (reproduces on `main`; tracked separately, #84), so running
    # it would add cross-platform noise unrelated to this fix.
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo test --all-features --no-run
      - run: cargo test --all-features --lib