pisserror 0.3.0

A golden rip-off of thiserror
Documentation
name: pisserror CI

on:
  push:
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  macro_version:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable

        # this'll fail if `pisserror` exports a mistmatched version of the macro
      - name: Check for macro version mismatch
        run: |
          cargo metadata --format-version=1 | jq -r -e '.packages[]
          | select(.name == "pisserror")
          | {"dep_ver": .dependencies[] | select(.name == "pisserror_macros").req, "workspace_ver": .version}
          | . as $json | $json.dep_ver | contains($json.workspace_ver)'

  lints:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: clippy
          toolchain: stable

      - name: Run Clippy
        run: cargo clippy --workspace

      # yeah, we're grabbing extra linters here
      - name: Install tools/linters
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-deny,cargo-semver-checks,cargo-msrv

      - name: Verify minimum supported Rust version (MSRV)
        run: cargo msrv verify

      - name: Scan for semantic versioning mistakes
        run: cargo semver-checks

      - name: Check licenses
        run: cargo deny check all

  run_checks:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        toolchain:
          - stable
          - nightly
      fail-fast: false
    name: Run checks (${{ matrix.toolchain }})

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}

      # <cache stuff>
      - name: Cache cargo registry
        uses: actions/cache@v3
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo index
        uses: actions/cache@v3
        with:
          path: ~/.cargo/git
          key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo build
        uses: actions/cache@v3
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo bin
        uses: actions/cache@v3
        with:
          path: ~/.cargo/bin
          key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
      # <end cache stuff>

      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-all-features

      - name: Build
        run: cargo build --verbose

      - name: Test `pisserror` crate
        run: cargo test-all-features

      - name: Test `macros` crate
        run: cargo test-all-features macros/