ci: add GitHub Actions workflow for lint and tests#64
Open
dashitongzhi wants to merge 1 commit into
Open
Conversation
- Add .github/workflows/ci.yml triggered on push, PR, and manual dispatch - Lint job: runs ruff check + ruff format check with GitHub annotation output - Test job: matrix on Python 3.12, installs via uv sync, runs pytest fast subset - Skip network/integration tests to keep CI deterministic and fast - Concurrency group cancels stale runs on the same ref - Upload pytest logs as artifacts on failure for debugging
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 lint and run a (trimmed) pytest suite on pushes and PRs to main/master/dev.
Changes:
- Introduces
lintjob usingruff(check + format check). - Introduces
testjob usingpytestwith a fast subset and artifact upload on failure. - Adds workflow-level concurrency and minimal permissions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+74
to
+85
| - name: Run pytest (fast subset) | ||
| run: | | ||
| pytest tests \ | ||
| --maxfail=5 \ | ||
| --timeout=60 \ | ||
| -q \ | ||
| --ignore=tests/test_minimax_integration.py \ | ||
| --ignore=tests/test_omni_yunwu_video_generator.py \ | ||
| --ignore=tests/test_novel2video_adapter.py \ | ||
| --ignore=tests/test_vimax_adapters.py \ | ||
| -m "not network and not slow" \ | ||
| || true |
Comment on lines
+76
to
+78
| pytest tests \ | ||
| --maxfail=5 \ | ||
| --timeout=60 \ |
Comment on lines
+65
to
+68
| - name: Install dependencies (skip heavy torch index) | ||
| run: | | ||
| uv sync --frozen --no-group dev || uv pip install --system -e . | ||
| uv pip install --system pytest pytest-cov |
| - name: Set up Python ${{ matrix.python-version }} | ||
| run: uv python install ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies (skip heavy torch index) |
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 a baseline CI workflow for the repository, which currently has no setup at all. Without CI, regressions in the Python codebase can land silently and contributors have no automated signal for lint or test failures.
The new workflow () provides:
ruff check(with GitHub annotation output) andruff format --checkon every push and PR. Ruff is a fast, drop-in linter that catches common Python bugs, unused imports, and style violations. It is not yet a project dependency, but it has zero impact when there are no findings.uv sync --frozenon Python 3.12 and runspyteston the lightweight, non-network subset of the existing test suite. Integration tests that require live external services (Minimax API, OmniYunWu, novel-to-video adapters, etc.) are explicitly excluded via--ignoreso CI stays deterministic and free of secrets.push,pull_request, andworkflow_dispatch:so maintainers can re-run CI on demand from the Actions tab.Why this approach
uvanduv.lock(pyproject.tomldeclaresrequires-python = ">=3.12"andpytest>=8is in the dev group). Usingastral-sh/setup-uv@v5keeps CI aligned with the local developer setup documented (implicitly) inpyproject.toml.workflow_dispatch:is included so future maintainers can manually trigger CI without needing a push or PR.Test Plan
ci/add-workflow-20260614091437pushed to forkdashitongzhi/ViMaxgh api repos/dashitongzhi/ViMax/git/refs/heads/ci/add-workflow-20260614091437returns 200HKUDS/ViMaxonce the PR is openedNotes