cargo-binutils 0.4.0

Proxy for LLVM tools like llvm-nm, llvm-objdump and llvm-size
Documentation
on:
  push:
    branches: [ master ]
  pull_request:
  merge_group:

name: Continuous integration

jobs:
  ci:
    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        rust:
          # MSRV
          - "1.70.0"
          - stable
        os: [ubuntu-latest, macos-latest, windows-latest]
        experimental: [false]
        include:
          - rust: nightly
            os: ubuntu-latest
            experimental: true

    steps:
      - uses: actions/checkout@v4
      - name: Setup Rust
        shell: bash
        run: |
          rustup toolchain install ${{ matrix.rust }} --profile minimal
          rustup default ${{ matrix.rust }}
          rustup component add llvm-tools clippy rustfmt
          echo "::add-matcher::.github/workflows/rust.json"

      - name: Clippy
        run: cargo clippy -- -D warnings

      - name: rustfmt
        run: cargo fmt --all -- --check

      - name: Build and install cargo-binutils
        if: matrix.rust == 'stable'
        run: cargo install --path . -f

      - name: Build and install cargo-binutils (--locked)
        if: matrix.rust != 'stable'
        run: cargo install --locked --path . -f

      - name: Run cargo-nm
        run: cargo nm --bin cargo-nm -- --undefined-only

      - name: Run cargo-objdump
        run: cargo objdump --bin cargo-objdump -- -h

      - name: Run cargo-objcopy (on Linux only)
        if: matrix.os == 'ubuntu-latest'
        run: cargo objcopy --bin cargo-objdump -v -- -O binary objdump.bin

      - name: Run cargo-size
        run: cargo size --bin cargo-size -v

      - name: Run cargo-strip (on Linux only)
        if: matrix.os == 'ubuntu-latest'
        run: cargo strip --bin cargo-strip -v

  conclusion:
    runs-on: ubuntu-latest
    needs: ci
    if: always()
    steps:
      - name: Done
        run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'