multiversed 0.3.1

Attribute macros wrapping multiversion with predefined SIMD target presets
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  test:
    name: Test ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - windows-latest
          - macos-latest
          - windows-11-arm
          - ubuntu-24.04-arm

    steps:
      - uses: actions/checkout@v6

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

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

      - name: Build (default features)
        run: cargo build --verbose

      - name: Test (default features)
        run: cargo test --verbose

      - name: Build (all features)
        run: cargo build --all-features --verbose

      - name: Test (all features)
        run: cargo test --all-features --verbose

      - name: Build (no default features)
        run: cargo build --no-default-features --verbose

      - name: Build (x86-64-v4 only)
        run: cargo build --no-default-features --features x86-64-v4 --verbose

      - name: Build (arm64 only)
        run: cargo build --no-default-features --features arm64 --verbose

      - name: Build (arm64-v2 only)
        run: cargo build --no-default-features --features arm64-v2 --verbose

      - name: Build (multiple arm64 tiers)
        run: cargo build --no-default-features --features "arm64,arm64-v2,arm64-v3" --verbose

      - name: Build (multiple x86 tiers)
        run: cargo build --no-default-features --features "x86-64-v3,x86-64-v4,x86-64-v4-modern" --verbose

      - name: Test (force-disable)
        run: cargo test --features force-disable --verbose

  # Test wasm32 target
  wasm:
    name: Test wasm32
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-unknown-unknown,wasm32-wasip1

      - name: Install wasmtime
        run: curl https://wasmtime.dev/install.sh -sSf | bash && echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH

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

      - name: Build for wasm32 (default features)
        run: cargo build --target wasm32-unknown-unknown --verbose

      - name: Build for wasm32 (all features)
        run: cargo build --target wasm32-unknown-unknown --all-features --verbose

      - name: Test wasm-simd128 crate (with simd128)
        run: cargo test -p test-wasm-simd128 --target wasm32-wasip1 -- --nocapture
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: wasmtime

      - name: Test wasm-simd128 crate (without simd128)
        run: cargo test -p test-wasm-simd128 --target wasm32-wasip1 -- --nocapture
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: wasmtime
          RUSTFLAGS: "-C target-feature=-simd128"

  # Cross-compilation tests
  cross:
    name: Cross-compile ${{ matrix.target }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          - aarch64-unknown-linux-gnu
          - x86_64-unknown-linux-gnu

    steps:
      - uses: actions/checkout@v6

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

      - name: Install cross-compilation tools
        if: matrix.target == 'aarch64-unknown-linux-gnu'
        run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu

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

      - name: Build (all features)
        run: cargo build --target ${{ matrix.target }} --all-features --verbose

  # Lint and format
  lint:
    name: Lint
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - 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 (default features)
        run: cargo clippy -- -D warnings

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

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

    steps:
      - uses: actions/checkout@v6

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

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

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