Move to pyproject.toml, rm setup & reqs #17
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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| FORCE_COLOR: 1 | |
| jobs: | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget ffmpeg libsndfile1 libasound2-dev | |
| ffmpeg -version | |
| - name: Download test audio file | |
| run: | | |
| wget -O example.wav https://cdn.chatwm.opensmodel.sberdevices.ru/GigaAM/example.wav | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| ${{ runner.os }}-pip- | |
| - name: Show disk usage before install | |
| run: df -h | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install --no-cache-dir torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cpu | |
| pip install --no-cache-dir -e ".[longform,tests]" | |
| - name: Show disk usage after install | |
| run: df -h | |
| - name: Run model loading tests | |
| run: | | |
| pytest -v tests/test_loading.py -m partial --tb=short | |
| - name: Run audio loading tests | |
| run: | | |
| pytest -v tests/test_reading.py --tb=short | |
| - name: Run batching tests | |
| run: | | |
| pytest -v tests/test_batching.py --tb=short | |
| - name: Run longform tests | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest -v tests/test_longform.py --tb=short | |
| - name: Run onnx tests | |
| run: | | |
| pytest -v tests/test_onnx.py --tb=short | |
| - name: Run all tests with coverage | |
| if: matrix.python-version == '3.10' | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest --cov=gigaam --cov-report=xml --cov-report=term-missing tests/ | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.10' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint and Format Check | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-lint- | |
| - name: Install linters | |
| run: | | |
| pip install --upgrade pip | |
| pip install flake8 black isort mypy types-requests | |
| - name: Check code formatting with black | |
| run: | | |
| black --check --diff gigaam/ tests/ | |
| - name: Check imports with isort | |
| run: | | |
| isort --check-only --diff gigaam/ tests/ | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 --ignore=E203,W503,W504 --max-line-length=120 --statistics gigaam/ tests/ | |
| - name: Type check with mypy | |
| run: | | |
| mypy gigaam/ --ignore-missing-imports --no-strict-optional |