name: Test pip install requirements

on:
  workflow_dispatch:
  push:
    branches:
      - main

jobs:
  build:
    strategy:
      max-parallel: 4
      matrix:
        platform: [ubuntu-latest, macos-14, windows-latest]
        python-version: ["3.10"]

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

    steps:
      - uses: actions/checkout@v4

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install torch
        run: python -m pip install torch==2.3.1 torchvision torchaudio
      - name: Install xformers
        if: matrix.platform == 'macos-14'
        run: |
          python -m pip install https://github.com/rsxdalv/xformers/releases/download/v0.0.27/xformers-0.0.27+184b280.d20241026-cp310-cp310-macosx_11_0_universal2.whl
      - name: Install xformers non-macos
        if: matrix.platform != 'macos-14'
        run: |
          python -m pip install xformers==0.0.27+cu118 --index-url https://download.pytorch.org/whl/cu118
      - name: Install dependencies
        # python -m pip install --upgrade pip==23.3.2
        # python -m pip install -r requirements.txt
        # python -m pip install -r requirements_bark_hubert_quantizer.txt
        # python -m pip install -r requirements_rvc.txt
        # python -m pip install -r requirements_audiocraft.txt
        # python -m pip install -r requirements_styletts2.txt
        # python -m pip install -r requirements_vall_e.txt
        # python -m pip install -r requirements_maha_tts.txt
        # python -m pip install -r requirements_stable_audio.txt
        # python -m pip install hydra-core==1.3.2
        # python -m pip install nvidia-ml-py
        run: |
          python -m pip install -r requirements.txt -r requirements_bark_hubert_quantizer.txt -r requirements_rvc.txt -r requirements_audiocraft.txt -r requirements_styletts2.txt -r requirements_vall_e.txt -r requirements_maha_tts.txt -r requirements_stable_audio.txt hydra-core==1.3.2 nvidia-ml-py

      # - name: Lint with ruff
      #   run: ruff check .
