Skip to content

fix: make tray audio controls source-oriented #42

fix: make tray audio controls source-oriented

fix: make tray audio controls source-oriented #42

Workflow file for this run

name: Python Tests
on:
pull_request:
paths:
- "*.py"
- "setup-requirements.txt"
- ".coveragerc"
- "tests/unit/**"
- "backends/advanced/src/**"
- "backends/advanced/tests/**"
- "backends/advanced/pyproject.toml"
- "backends/advanced/uv.lock"
- "extras/asr-services/common/**"
- "extras/asr-services/providers/**"
- "extras/asr-services/tests/**"
- "extras/asr-services/pyproject.toml"
- "extras/asr-services/uv.lock"
- ".github/workflows/python-tests.yml"
push:
branches: [dev, main]
workflow_dispatch:
permissions:
contents: read
jobs:
root-unit:
name: Root tooling unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
env:
PYTHONPATH: ${{ github.workspace }}/backends/advanced/src
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Run unit tests with coverage
run: >-
uv run
--with-requirements setup-requirements.txt
--with pytest
--with pytest-cov
pytest tests/unit
--cov
--cov-config=.coveragerc
--cov-report=term-missing
--cov-report=xml
--cov-report=html
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: root-unit-coverage
path: coverage-reports/
if-no-files-found: warn
retention-days: 14
advanced-backend-unit:
name: Advanced backend unit tests
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: backends/advanced
services:
# Some backend tests hit real local services (vault locks are Redis-backed
# and fail closed; test_leading_silence_trim_db uses Mongo). Match the
# defaults the code assumes: redis://localhost:6379, mongodb://localhost:27018.
redis:
image: redis:7-alpine
ports:
- 6379:6379
mongo:
image: mongo:8
ports:
- 27018:27017
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install system dependencies
# libopus0: native library behind opuslib (services/device_audio.py),
# imported transitively during test collection.
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libopus0
- name: Install test dependencies
run: uv sync --locked --group test
- name: Run unit tests with coverage
run: >-
uv run --group test pytest
--ignore=tests/test_audio_persistence_mongodb.py
--cov=advanced_omi_backend
--cov-report=term-missing
--cov-report=xml
--cov-report=html
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: advanced-backend-unit-coverage
path: backends/advanced/coverage-reports/
if-no-files-found: warn
retention-days: 14
asr-unit:
name: ASR unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: extras/asr-services
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install test dependencies
run: uv sync --locked --group test
- name: Run unit tests with coverage
run: >-
uv run --group test pytest
--ignore=tests/test_parakeet_service.py
--cov=common
--cov=providers
--cov-report=term-missing
--cov-report=xml
--cov-report=html
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: asr-unit-coverage
path: extras/asr-services/coverage-reports/
if-no-files-found: warn
retention-days: 14