lean_string 0.6.0

Compact, clone-on-write string.
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: "always"
  RUSTFLAGS: "-D warnings"
  PROPTEST_CASES: 10000
  MIRIFLAGS: "-Zmiri-strict-provenance"

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

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

      - name: Lint check
        run: |
          cargo check --all-features
          cargo clippy --all-features

  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        opt: ["", "--release"]
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Test (default)
        run: cargo test ${{ matrix.opt }}

      - name: Test (no-default-features)
        run: cargo test ${{ matrix.opt }} --no-default-features

      - name: Test (all-features)
        run: cargo test ${{ matrix.opt }} --all-features

      - name: Test (Loom)
        run: RUSTFLAGS="--cfg loom" cargo test --test loom ${{ matrix.opt }} --features loom -- --test-threads=1

  miri:
    name: Miri (${{ matrix.name }})
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - name: 64-bit LE
            target: x86_64-unknown-linux-gnu
          - name: 64-bit BE
            target: powerpc64-unknown-linux-gnu
          - name: 32-bit LE
            target: i686-unknown-linux-gnu
          - name: 32-bit BE
            target: powerpc-unknown-linux-gnu
      fail-fast: false
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install Miri
        run: |
          rustup toolchain install nightly --profile minimal
          rustup +nightly component add miri

      - name: Rust Cache
        uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
        with:
          prefix-key: rust
          shared-key: miri-${{ matrix.target }}

      - name: Test (default)
        run: cargo +nightly miri test --target ${{ matrix.target }}

      - name: Test (no-default-features)
        run: cargo +nightly miri test --target ${{ matrix.target }} --no-default-features

      - name: Test (all-features)
        run: cargo +nightly miri test --target ${{ matrix.target }} --all-features

      - name: Test (race condition)
        env:
          MIRIFLAGS: "-Zmiri-strict-provenance -Zmiri-preemption-rate=1"
        run: cargo +nightly miri test --target ${{ matrix.target }} --test race_condition