name: Test the package
on:
  push:
    branches: [main, dev-branch]
  pull_request:
    branches: [main, dev-branch]

jobs:
  test-cpu:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo test --release --no-default-features

  test-gpu:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Install Vulkan (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libvulkan1 mesa-vulkan-drivers libgl1-mesa-dri
          echo "WGPU_BACKEND=vulkan" >> $GITHUB_ENV
      - run: cargo test --release --all-features
