smop 0.2.1

Batteries-included scripting utilities for Rust
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -Dwarnings

jobs:
  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Run tests (all features)
        run: cargo test --all-features

      - name: Run tests (no default features)
        run: cargo test --no-default-features

      - name: Run tests (individual features)
        run: |
          cargo test --no-default-features --features http
          cargo test --no-default-features --features cli
          cargo test --no-default-features --features print
          cargo test --no-default-features --features csv

  lint:
    name: Lint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --check

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

  docs:
    name: Documentation
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Build docs
        run: cargo doc --no-deps --all-features
        env:
          RUSTDOCFLAGS: -Dwarnings

  msrv:
    name: MSRV Check
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust (MSRV)
        uses: dtolnay/rust-toolchain@master
        with:
          # Rust 2024 edition requires 1.85+
          toolchain: "1.85"

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Check MSRV
        run: cargo check --all-features