Skip to content

Revert "chore(deps): bump actions/checkout from 5 to 6" #205

Revert "chore(deps): bump actions/checkout from 5 to 6"

Revert "chore(deps): bump actions/checkout from 5 to 6" #205

Workflow file for this run

name: Python
on:
push:
pull_request:
workflow_dispatch:
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Check formatting
run: uv run ruff format --check .
- name: Lint code
run: uv run ruff check .
type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3"
- name: Install dependencies
run: uv sync
- name: Run mypy
run: uv run mypy src/fishaudio --ignore-missing-imports
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3"]
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync
- name: Run tests with coverage
run: uv run pytest tests/unit/ -v --cov=src/fishaudio --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3'
with:
files: ./coverage.xml
fail_ci_if_error: false
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.9"
- name: Install dependencies
run: uv sync
- name: Run integration tests
run: uv run pytest tests/integration/ -v
env:
FISH_API_KEY: ${{ secrets.FISH_API_KEY }}
- name: Upload Test Artifacts
uses: actions/upload-artifact@v5
if: always()
with:
name: test-audio-output
path: output/
build:
name: Build Package
runs-on: ubuntu-latest
needs: [lint, type-check, test, integration]
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build package
run: uv build
- name: Check package
run: uv run python -c "import fishaudio; print(f'fishaudio v{fishaudio.__version__}')"
- name: Upload build artifacts
uses: actions/upload-artifact@v5
with:
name: dist
path: dist/
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [lint, type-check, test, integration, build]
if: startsWith(github.ref, 'refs/tags/')
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1