simdeez 3.0.1

SIMD library to abstract over different instruction sets and widths
Documentation
on: [pull_request]

name: Tests

jobs:
  checks:
    name: Code Checks (formatting, clippy)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Initialize Cargo
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
          targets: aarch64-unknown-linux-gnu

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

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

      - name: Clippy check (x86)
        run: cargo clippy --all --all-targets -- --deny warnings

      - name: Clippy check (arm64)
        run: cargo clippy --all --all-targets --target aarch64-unknown-linux-gnu -- --deny warnings

  x86_tests:
    name: x86 Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Initialize Cargo
        uses: dtolnay/rust-toolchain@stable

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

      - name: Run tests (debug)
        run: cargo test

      - name: Run tests (release)
        run: cargo test --release

      # AVX-512 is not available on GitHub's hosted runners, so compile the library and
      # test harness with the relevant target features enabled to keep that path covered.
      - name: Compile tests with AVX-512 enabled
        run: CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS='-C target-feature=+avx512f,+avx512bw,+avx512dq' cargo test --tests --target x86_64-unknown-linux-gnu --no-run

      - name: Compile library with AVX-512 enabled (release)
        run: CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS='-C target-feature=+avx512f,+avx512bw,+avx512dq' cargo test --release --lib --target x86_64-unknown-linux-gnu --no-run

  arm_tests:
    name: Arm Neon Tests
    runs-on: ubuntu-latest
    env:
      QEMU_LD_PREFIX: /usr/aarch64-linux-gnu
    steps:
      - uses: actions/checkout@v4

      - name: Install dependencies
        run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user

      - name: Initialize Cargo
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: aarch64-unknown-linux-gnu

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

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
        with:
          platforms: aarch64

      - name: Run tests (release)
        run: cargo test --release --target aarch64-unknown-linux-gnu

  wasm_tests:
    name: WebAssembly Tests
    runs-on: ubuntu-latest
    env:
      WASMTIME_BACKTRACE_DETAILS: 1
    steps:
      - uses: actions/checkout@v4

      - name: Setup `wasmtime`
        uses: bytecodealliance/actions/wasmtime/setup@v1

      - name: Initialize Cargo
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-wasip1

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

      - name: Run tests (release)
        run: cargo test --release --target wasm32-wasip1