Skip to content

feat: add M4B merge script and uv package manager support #36

feat: add M4B merge script and uv package manager support

feat: add M4B merge script and uv package manager support #36

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
jobs:
lint:
name: Lint with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run ruff check
uses: astral-sh/ruff-action@v3
with:
args: "check --output-format=github"
- name: Run ruff format check
uses: astral-sh/ruff-action@v3
with:
args: "format --check --diff"
type-check:
name: Type Checking
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --all-extras
- name: Run mypy
run: |
uv run mypy lalo/ --show-error-codes --pretty
- name: Run pyright
run: |
uv run pyright lalo/
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install Python dependencies
run: |
uv sync --all-extras
- name: Run tests with pytest
run: |
# Exclude E2E tests (require GPU)
uv run pytest tests/ -v --cov=lalo --cov-report=xml --cov-report=term-missing --ignore=tests/e2e -m "not gpu"
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build package
run: |
uv build
- name: Check package with twine
run: |
uvx twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
quality-gate:
name: Quality Gate
runs-on: ubuntu-latest
needs: [lint, type-check, test]
if: always()
steps:
- name: Check job results
run: |
echo "Lint: ${{ needs.lint.result }}"
echo "Type Check: ${{ needs.type-check.result }}"
echo "Test: ${{ needs.test.result }}"
if [[ "${{ needs.lint.result }}" != "success" ]]; then
echo "❌ Lint failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "❌ Tests failed"
exit 1
fi
echo "✅ All required checks passed!"