rifft 1.1.2

RIFFT FFT/DLPack/FFI bridge
Documentation
name: RIFFT CI

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

jobs:
  lint-test:
    runs-on: ubuntu-22.04
    env:
      RUSTFLAGS: -C target-cpu=native

    steps:
      - uses: actions/checkout@v4

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

      - name: Cargo fmt
        run: cargo fmt --all -- --check

      - name: Cargo clippy
        run: cargo clippy --all-targets -- -D warnings

      - name: Cargo test
        run: cargo test

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Prepare Python env
        env:
          CUDA_VISIBLE_DEVICES: ""
        run: |
          python -m venv .venv
          source .venv/bin/activate
          pip install --upgrade pip
          pip install maturin pytest "numpy<2"
          pip install --index-url https://download.pytorch.org/whl/cpu torch==2.2.2+cpu

      - name: Build Python extension
        env:
          RUSTUP_TOOLCHAIN: stable
          RIFFT_USE_VENV: "1"
        run: |
          source .venv/bin/activate
          ./scripts/install_python_binding.sh --locked

      - name: Pytest
        env:
          RIFFT_USE_VENV: "1"
        run: |
          source .venv/bin/activate
          pytest python/tests -q