Updating versions #14
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-copy, working-branch ] | |
| pull_request: | |
| branches: [ main-copy, working-branch ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Create virtual environment | |
| run: uv venv | |
| - name: Activate virtual environment | |
| run: source .venv/bin/activate | |
| - name: Install dependencies | |
| run: uv pip install -e ".[dev]" | |
| - name: Lint with flake8 | |
| run: | | |
| # Stop the build if there are Python syntax errors or undefined names | |
| uv run python -m flake8 src/audio_processing_ai/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| uv run python -m flake8 src/audio_processing_ai/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics | |
| - name: Type check with mypy | |
| run: uv run python -m mypy src/audio_processing_ai/ --ignore-missing-imports --no-error-summary | |
| - name: Format check with black | |
| run: uv run python -m black --check src/audio_processing_ai/ tests/ | |
| - name: Import sort check with isort | |
| run: uv run python -m isort --check-only src/audio_processing_ai/ tests/ | |
| - name: Test with pytest | |
| run: uv run python -m pytest tests/ -v --cov=src/audio_processing_ai --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.9' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.9" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Install build dependencies | |
| run: uv pip install build twine | |
| - name: Build package | |
| run: uv run python -m build | |
| - name: Check package | |
| run: uv run twine check dist/* | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: dist | |
| path: dist/ | |
| test-scripts: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.9" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: uv pip install -e . | |
| - name: Test train.py help | |
| run: uv run python train.py --help | |
| - name: Test predict.py help | |
| run: uv run python predict.py --help | |
| - name: Test threshold_sweep.py import | |
| run: uv run python -c "import sys; sys.path.append('src/audio_processing_ai/scripts'); import threshold_sweep; print('threshold_sweep imports successfully')" |