cap-std-ext 1.0.2

Extension APIs for cap-std
Documentation
# Inspired by https://github.com/rust-analyzer/rust-analyzer/blob/master/.github/workflows/ci.yaml
# but tweaked in several ways.  If you make changes here, consider doing so across other
# repositories in e.g. ostreedev etc.
name: Rust

permissions:
  actions: read

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

env:
  CARGO_TERM_COLOR: always
  # Pinned toolchain for linting
  ACTION_LINTS_TOOLCHAIN: 1.58.1

jobs:
  build:
    name: "Build"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - name: Cache Dependencies
        uses: Swatinem/rust-cache@v2
      - name: Compile (no features)
        run: cargo test --no-run
      - name: Compile (all features)
        run: cargo test --no-run --all-features
      - name: Test
        run: cargo test --all-features -- --nocapture --quiet
  build-minimum-toolchain:
    name: "Build, minimum supported toolchain (MSRV)"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Detect crate MSRV
        shell: bash
        run: |
          msrv=$(cargo metadata --format-version 1 --no-deps | \
              jq -r '.packages | .[0].rust_version')
          echo "Crate MSRV: $msrv"
          echo "ACTION_MSRV_TOOLCHAIN=$msrv" >> $GITHUB_ENV
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN']  }}
      - name: Cache Dependencies
        uses: Swatinem/rust-cache@v2
      - name: cargo check
        run: cargo check
  linting:
    name: "Lints, pinned toolchain"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN']  }}
          components: rustfmt, clippy
      - name: cargo fmt (check)
        run: cargo fmt -- --check -l
      - name: cargo clippy (warnings)
        run: cargo clippy -- -D warnings