ci: add GitHub Actions workflow for lint and import smoke test - #316
Open
dashitongzhi wants to merge 1 commit into
Open
ci: add GitHub Actions workflow for lint and import smoke test#316dashitongzhi wants to merge 1 commit into
dashitongzhi wants to merge 1 commit into
Conversation
- Add CI workflow (.github/workflows/ci.yml) with workflow_dispatch trigger plus push/PR triggers on main and master. - Run ruff lint and ruff format --check across the repo to catch style regressions early. - Add a lightweight import smoke job that installs the package without heavy audio/ML deps to verify package metadata and that RealtimeSTT is importable. - Use Python 3.11 with pip caching to keep CI runs fast and reproducible.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a GitHub Actions CI workflow to run Python linting/format checks via Ruff and a basic import smoke test to catch packaging/import regressions early.
Changes:
- Introduces a CI workflow triggered on pushes/PRs to
main/masterplus manual dispatch. - Adds a Ruff lint + format-check job.
- Adds an “import smoke” job that installs selected deps and verifies imports/metadata.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+49
to
+54
| - name: Install package (no audio deps) | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| # Skip heavy audio/ML deps; just verify the package tree imports | ||
| python -m pip install faster-whisper halo soundfile numpy | ||
| python -m pip install -e . --no-deps |
Comment on lines
+56
to
+59
| - name: Verify package metadata | ||
| run: | | ||
| python -c "import RealtimeSTT" && echo "RealtimeSTT import OK" | ||
| python -c "import setup; print('setup.py parses OK')" |
Comment on lines
+27
to
+28
| - name: Install ruff | ||
| run: python -m pip install --upgrade pip ruff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the project's first GitHub Actions workflow under
.github/workflows/ci.yml. The repository previously had a.github/workflows/directory but no workflow files, so pushes and pull requests were not validated automatically.The new workflow runs on:
pushandpull_requestagainstmain/masterworkflow_dispatch(manual trigger from the Actions tab)It contains two jobs:
ruff) — runsruff check .andruff format --check .against the entire repository on Python 3.11. This catches style regressions and common bug patterns early without requiring reviewers to run lint locally.pip install -e . --no-depsplus a minimal subset of runtime dependencies (faster-whisper,halo,soundfile,numpy), then verifies thatimport RealtimeSTTsucceeds andsetup.pyparses. This catches packaging / import-order breakage on every PR without pulling the heavy audio / CUDA stack.pip caching is enabled via
actions/setup-python@v5to keep runs fast.Why this option
The repo had an empty
.github/workflows/directory and no CONTRIBUTING.md, CODE_OF_CONDUCT.md, or SECURITY.md. A CI workflow is the highest-leverage first addition: it unblocks future automated checks (typing, tests, builds) and gives contributors an immediate signal when something is broken.Test Plan
Actions -> CI -> Run workflowis available from the Actions tab (manual dispatch)ruff check .andruff format --check .succeed against currentmain(some existing files may surface warnings; those can be addressed in a follow-up PR or by configuring[tool.ruff]extend-ignore/ per-file overrides)