Skip to content

feat: add GitHub CI/CD integration for testing and release - #5

Merged
codeasier merged 2 commits into
mainfrom
20260412/ci-cd-integration
Apr 11, 2026
Merged

codeasier merged 2 commits into
mainfrom
20260412/ci-cd-integration

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

This PR adds a complete GitHub Actions CI/CD pipeline to pt-snap-cli:

  1. Test workflow (.github/workflows/test.yml) — triggers on push/PR to main

    • Lint job: Ruff lint + Black format check on Python 3.13
    • Test job: pytest --cov matrix across Python 3.10/3.11/3.12/3.13
    • pip dependency caching to speed up runs
    • Coverage XML artifact upload (Python 3.13 only, 30-day retention)
    • Concurrency control to cancel stale runs on the same branch
  2. Release workflow (.github/workflows/release.yml) — triggers on v* tag push

    • Builds sdist and wheel via python -m build
    • Validates tag version matches pyproject.toml version
    • Verifies the built package installs and pt-snap --version runs
    • Publishes to PyPI via OIDC Trusted Publishing (no API token needed)
  3. pyproject.toml updates

    • Added project.urls (Homepage, Repository, Issues)
    • Added build>=1.0.0 to dev dependencies
    • Added tool.coverage configuration (source, branch, omit, XML output)

🔗 Related Issue

Fixes #4

🧪 Testing

  • Tests added/updated
  • Manual testing completed
    • Verified pt-snap --version runs locally after install
    • Workflow YAML syntax validated against GitHub Actions schema

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

📸 Screenshots (if applicable)

📋 Additional Notes

  • PyPI Trusted Publishing (OIDC) needs to be configured on the PyPI project side before the release workflow can publish. See PyPI Trusted Publishing docs for setup instructions.
  • Coverage fail_under is set to 0 as a starting point; it can be raised incrementally as test coverage improves.

codeasier and others added 2 commits April 12, 2026 02:45
- Add test workflow with lint (ruff + black) and multi-Python
  version test matrix (3.10-3.13)
- Add release workflow triggered by v* tags, building sdist/wheel
  and publishing to PyPI via OIDC Trusted Publishing
- Add coverage configuration to pyproject.toml
- Add build dependency and project URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix trailing whitespace on blank lines (ruff W293)
- Rename unused loop variable (ruff B007)
- Remove duplicate TestIn/TestLike classes (ruff F811)
- Sort imports (ruff I001)
- Apply black formatting to 12 files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codeasier
codeasier merged commit d926a0e into main Apr 11, 2026
5 checks passed
@codeasier
codeasier deleted the 20260412/ci-cd-integration branch April 17, 2026 13:30
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.

[FEATURE] GitHub CI/CD 集成 — 自动化测试、格式检查与发布流水线

1 participant