Skip to content

Making ci changes and refactoring changes #1

Making ci changes and refactoring changes

Making ci changes and refactoring changes #1

Workflow file for this run

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
flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Type check with mypy
run: mypy src/audio_processing_ai/ --ignore-missing-imports
- name: Format check with black
run: black --check src/ tests/
- name: Import sort check with isort
run: isort --check-only src/ tests/
- name: Test with pytest
run: 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: python train.py --help
- name: Test predict.py help
run: python predict.py --help
- name: Test threshold_sweep.py import
run: python -c "import sys; sys.path.append('src/audio_processing_ai/scripts'); import threshold_sweep; print('threshold_sweep imports successfully')"