shrinkpath 0.1.2

Smart cross-platform path shortening for CLIs, prompts, and tools
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable, "1.70"]
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
        with:
          toolchain: ${{ matrix.rust }}
      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
      # MSRV job: test lib only (no clap, which requires newer rustc)
      - name: Test lib (no default features)
        if: matrix.rust != 'stable'
        run: cargo test --no-default-features --lib
      - name: Test lib (default features)
        if: matrix.rust == 'stable'
        run: cargo test --lib
      - name: Test lib (fs feature)
        if: matrix.rust == 'stable'
        run: cargo test --features fs --lib
      - name: Doc-tests
        if: matrix.rust == 'stable'
        run: cargo test --doc

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
        with:
          toolchain: stable
          components: clippy
      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
      - run: cargo clippy --all-targets -- -D warnings
      - run: cargo clippy --all-targets --features fs -- -D warnings

  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
        with:
          toolchain: stable
          components: rustfmt
      - run: cargo fmt --check

  deny:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2

  vet:
    name: Cargo Vet (supply-chain)
    runs-on: ubuntu-latest
    # Complements `deny` (known-bad advisories/licenses) with the supply-chain-
    # injection layer: every dependency version must be human-source-reviewed or
    # covered by an imported aggregate audit set (Google/Mozilla/Bytecode-Alliance/
    # Embark). Config in supply-chain/{config,audits,imports}.toml.
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: dtolnay/rust-toolchain@stable
      - name: Install cargo-vet
        uses: taiki-e/install-action@59012be0884e296ca2da49b530610e72c49039ad # v2.81.6
        with:
          tool: cargo-vet
      - name: Fetch dependencies
        run: cargo fetch
      - name: Check supply chain
        run: cargo vet --locked