From 0ef3341d67fafde46029459b5f8a9008b7c5b615 Mon Sep 17 00:00:00 2001 From: pretyflaco Date: Mon, 4 May 2026 21:30:41 +0300 Subject: [PATCH] chore: add minimal CI workflow with ruff and pytest PR #4 was reviewed and merged with no automated checks because the repo had no CI. Add a minimal MVP workflow so future PRs surface lint and focused unit-test results. Scope (intentionally narrow for first iteration): - Ubuntu latest, Python 3.12 only (matrix expansion is follow-up). - Minimal dependency install: ruff, pytest, numpy, click, reportlab, requests, and the package itself with --no-deps. Skips the [dev] extra to avoid pulling whisperx + torch (~700MB). - Ruff scoped to the actively-maintained files (transcribe, cli, test_transcribe, test_utils). Wider scope is tracked as a follow-up to this MVP. - Pytest runs the focused unit tests; the dual-channel dispatch test imports whisperx at runtime and is deselected. tests/test_cli.py is run only when present (lands with issue #8). Closes #9 --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d156785 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +"on": + push: + branches: [main] + pull_request: + +jobs: + lint-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + + # ffmpeg/ffprobe are required at runtime by meet_record.audio + # (read_stereo_channels probes channels via ffprobe and decodes via + # ffmpeg). ubuntu-latest preinstalls ffmpeg in /usr/bin since 2023+, + # but install it explicitly for forward compat. + - name: Install ffmpeg + run: | + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends ffmpeg + + # The full [dev] extra would pull in whisperx + torch (~700MB) which is + # overkill for the lint + focused-unit-test loop. Install the minimal + # set of runtime deps the focused tests actually exercise, plus the + # tooling. Issue #9 tracks expanding this if/when broader integration + # tests are added. + - name: Install minimal dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ruff pytest numpy click reportlab requests + # meetscribe-record is required at import time (meet/languages.py + # re-exports from meet_record.languages). Pull it from PyPI but + # skip its optional GUI/pyaudio extras. + python -m pip install meetscribe-record + python -m pip install -e . --no-deps + + - name: Ruff lint (focused) + # Scope ruff to the files actively maintained for lint cleanliness. + # The full meet/ + tests/ tree has historical lint debt; expanding the + # scope is tracked as a follow-up to this MVP CI workflow. + run: | + ruff check \ + meet/transcribe.py \ + meet/cli.py \ + tests/test_transcribe.py \ + tests/test_utils.py + + - name: Pytest (focused) + # The dual_mixdown dispatch test imports whisperx at runtime; deselect + # it under the no-whisperx CI environment. Most other transcribe tests + # monkeypatch their dependencies and run without torch/whisperx. + # tests/test_capture.py and tests/test_label.py exercise audio/system + # tooling not available in plain ubuntu-latest; skip for the MVP. + # tests/test_cli.py is run only when present (it's added by issue #8). + run: | + pytest \ + tests/test_transcribe.py \ + tests/test_utils.py \ + -v \ + --deselect tests/test_transcribe.py::TestDualChannelDispatch::test_dual_mixdown_dispatches_to_dual_channel + if [ -f tests/test_cli.py ]; then + pytest tests/test_cli.py -v + fi