rambo 0.1.1

A tool to map ROM collateral damage
Documentation
name: CI

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

# Cancel older in-flight runs for the same branch/PR. Stops a fresh
# push from sitting behind an obsolete run that's still consuming
# runners (which is the most common cause of perceived "serial"
# execution).
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

jobs:
  fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all -- --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install probe-rs system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y libudev-dev pkg-config
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-targets --all-features -- -D warnings

  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      # Run all three OS variants in parallel. Locked in explicitly so
      # a future matrix expansion can't silently cap concurrency.
      max-parallel: 3
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v4
      - name: Install probe-rs system dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libudev-dev pkg-config
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --all-targets --all-features --verbose
      - run: cargo test --all-features --verbose

  semver-checks:
    name: SemVer checks
    runs-on: ubuntu-latest
    # Only meaningful on PRs: there is no useful baseline when pushing
    # straight to main (we'd compare main against itself).
    if: github.event_name == 'pull_request'
    steps:
      - uses: actions/checkout@v4
      - name: Install probe-rs system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y libudev-dev pkg-config
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: obi1kenobi/cargo-semver-checks-action@v2