Vectorize weighted distance in the sonic similarity provider #17102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will install Python dependencies, run tests and lint | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - stable | |
| - dev | |
| pull_request: | |
| branches: | |
| - stable | |
| - dev | |
| workflow_dispatch: | |
| workflow_call: | |
| inputs: | |
| ref: | |
| description: "Git ref to checkout" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code from GitHub | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version-file: ".python-version" | |
| check-latest: true | |
| # Cache apt .deb files to speed up ffmpeg installation (in home to avoid permission issues). | |
| - name: Cache apt packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/apt-packages | |
| key: apt-ffmpeg-${{ runner.os }} | |
| - name: Install ffmpeg | |
| run: | | |
| # Restore cached .deb files to apt cache (if any) | |
| sudo cp ~/.cache/apt-packages/*.deb /var/cache/apt/archives/ 2>/dev/null || true | |
| sudo apt-get update && sudo apt-get install -y ffmpeg | |
| # Save .deb files for next run | |
| mkdir -p ~/.cache/apt-packages && cp /var/cache/apt/archives/*.deb ~/.cache/apt-packages/ 2>/dev/null || true | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Cache uv packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('.python-version') }}-${{ hashFiles('requirements_all.txt', 'pyproject.toml') }} | |
| - name: Install dependencies | |
| # --index-strategy: allow PyPI packages when also using the PyTorch extra index | |
| # https://docs.astral.sh/uv/pip/compatibility/#packages-that-exist-on-multiple-indexes | |
| run: uv pip install --system --index-strategy unsafe-best-match . .[test] -r requirements_all.txt | |
| - name: Lint/test with pre-commit | |
| run: SKIP=no-commit-to-branch pre-commit run --all-files | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code from GitHub | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version-file: ".python-version" | |
| check-latest: true | |
| # Cache apt .deb files to speed up ffmpeg installation (in home to avoid permission issues). | |
| - name: Cache apt packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/apt-packages | |
| key: apt-ffmpeg-${{ runner.os }} | |
| - name: Install ffmpeg | |
| run: | | |
| # Restore cached .deb files to apt cache (if any) | |
| sudo cp ~/.cache/apt-packages/*.deb /var/cache/apt/archives/ 2>/dev/null || true | |
| sudo apt-get update && sudo apt-get install -y ffmpeg | |
| # Save .deb files for next run | |
| mkdir -p ~/.cache/apt-packages && cp /var/cache/apt/archives/*.deb ~/.cache/apt-packages/ 2>/dev/null || true | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Cache uv packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('.python-version') }}-${{ hashFiles('requirements_all.txt', 'pyproject.toml') }} | |
| - name: Install dependencies | |
| # --index-strategy: allow PyPI packages when also using the PyTorch extra index | |
| # https://docs.astral.sh/uv/pip/compatibility/#packages-that-exist-on-multiple-indexes | |
| run: uv pip install --system --index-strategy unsafe-best-match . .[test] -r requirements_all.txt | |
| - name: Pytest | |
| run: pytest --durations 10 --cov-report term-missing --cov=music_assistant --cov-report=xml tests/ |