rcman 0.2.2

Framework-agnostic settings management with schema, backup/restore, secrets and derive macro support
Documentation
name: CI

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

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

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install system dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libdbus-1-dev pkg-config

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

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

      # Format check - Fast, run on Ubuntu only
      - name: Format check
        if: matrix.os == 'ubuntu-latest'
        run: cargo fmt --all -- --check

      # Clippy - Run on all platforms to catch platform-specific issues
      - name: Clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      # Test - Run on all platforms to verify behavior
      - name: Test
        run: cargo test --all --all-features --quiet

      # Checks below this line are run only on Ubuntu to save resources

      - name: Cargo deny (licenses and bans)
        if: matrix.os == 'ubuntu-latest'
        uses: EmbarkStudios/cargo-deny-action@v2
        with:
          # Note: advisories check disabled until cargo-deny supports CVSS 4.0
          # https://github.com/EmbarkStudios/cargo-deny/issues/635
          command: check licenses bans

      - name: Build docs (docsrs cfg)
        if: matrix.os == 'ubuntu-latest'
        env:
          RUSTDOCFLAGS: "--cfg docsrs"
        run: cargo doc --all-features --no-deps

      - name: Check clippy pedantic (all targets)
        if: matrix.os == 'ubuntu-latest'
        run: cargo clippy --features full -- -W clippy::pedantic

  cross-check:
    name: Cross-compile (${{ matrix.target }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-pc-windows-gnu
            os: ubuntu-latest
            use-cross: true
          - target: aarch64-linux-android
            os: ubuntu-latest
            use-cross: true
          - target: x86_64-apple-darwin
            os: macos-latest
            use-cross: false
          - target: aarch64-apple-darwin
            os: macos-latest
            use-cross: false
          - target: aarch64-apple-ios
            os: macos-latest
            use-cross: false

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install system dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libdbus-1-dev pkg-config

      - name: Setup Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Setup cross-compilation toolchain
        if: matrix.use-cross
        uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2
        with:
          key: cross-${{ matrix.target }}

      - name: Check
        run: cargo check --all --all-features --target ${{ matrix.target }}

      - name: Clippy
        run: cargo clippy --all-features --target ${{ matrix.target }} -- -D warnings