Skip to content

ci: add GitHub Actions workflow for lint and tests#64

Open
dashitongzhi wants to merge 1 commit into
HKUDS:mainfrom
dashitongzhi:ci/add-workflow-20260614091437
Open

ci: add GitHub Actions workflow for lint and tests#64
dashitongzhi wants to merge 1 commit into
HKUDS:mainfrom
dashitongzhi:ci/add-workflow-20260614091437

Conversation

@dashitongzhi

Copy link
Copy Markdown

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:

  • Lint job — runs ruff check (with GitHub annotation output) and ruff format --check on 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.
  • Test job — installs the project via uv sync --frozen on Python 3.12 and runs pytest on 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 --ignore so CI stays deterministic and free of secrets.
  • Triggerspush, pull_request, and workflow_dispatch: so maintainers can re-run CI on demand from the Actions tab.
  • Concurrency — cancels in-progress runs on the same ref to save CI minutes.
  • Failure artifacts — uploads pytest logs on failure for easier debugging.

Why this approach

  • The project already uses uv and uv.lock (pyproject.toml declares requires-python = ">=3.12" and pytest>=8 is in the dev group). Using astral-sh/setup-uv@v5 keeps CI aligned with the local developer setup documented (implicitly) in pyproject.toml.
  • Skipping network/integration tests avoids requiring maintainers to provision API keys in CI secrets just to get basic coverage. The integration tests remain runnable locally.
  • workflow_dispatch: is included so future maintainers can manually trigger CI without needing a push or PR.

Test Plan

  • Branch ci/add-workflow-20260614091437 pushed to fork dashitongzhi/ViMax
  • gh api repos/dashitongzhi/ViMax/git/refs/heads/ci/add-workflow-20260614091437 returns 200
  • CI passes on this PR (lint + pytest)
  • First workflow run visible under the Actions tab on HKUDS/ViMax once the PR is opened

Notes

  • No production code is modified; the change is additive only.
  • If ruff is undesired, the lint job can be removed and only the test job kept — both are isolated and will not block merge unless the maintainer chooses to make CI required.

- 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
Copilot AI review requested due to automatic review settings June 14, 2026 01:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 lint job using ruff (check + format check).
  • Introduces test job using pytest with 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 thread .github/workflows/ci.yml
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 thread .github/workflows/ci.yml
Comment on lines +76 to +78
pytest tests \
--maxfail=5 \
--timeout=60 \
Comment thread .github/workflows/ci.yml
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
Comment thread .github/workflows/ci.yml
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies (skip heavy torch index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants