-
Notifications
You must be signed in to change notification settings - Fork 1
CI CD Workflows
Rudra644 edited this page Jun 18, 2026
·
1 revision
PyChase ships with three ready-to-use GitHub Actions workflows in .github/workflows/ to automate duplicate code detection in your CI/CD pipeline.
| Workflow | File | Trigger | Purpose |
|---|---|---|---|
| CI | ci.yml |
Push / PR to master
|
Tests PyChase against the full demo suite on Python 3.10–3.13 |
| Publish | workflow.yml |
GitHub Release published | Builds and uploads PyChase to PyPI |
| Quality | quality.yml |
Push / PR to master
|
Self-analysis: runs PyChase on its own source code and generates a quality report |
The CI workflow runs on every push and pull request to master. It:
- Checks out the repository
- Sets up Python (3.10, 3.11, 3.12, 3.13 in parallel)
- Runs the full demo test suite at two thresholds
- Validates JSON, CSV, and HTML output formats
- Verifies zero false positives on the
13_unique_code.pyfile - Runs PyChase on its own source (
pychase/directory)
name: CI
on:
push: { branches: [master] }
pull_request: { branches: [master] }
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: python -m pychase --threshold 0.55 --min-lines 2 --min-nodes 10 demo/
- run: python -m pychase --threshold 0.7 demo/
- run: python -m pychase --json --threshold 0.5 demo/ | python -m json.tool
- run: python -m pychase --format html --output report.html demo/
- run: python -m pychase --threshold 0.7 pychase/Triggered when you create a GitHub Release. It:
- Builds the package with
python -m build - Publishes to PyPI using trusted publishing (
pypa/gh-action-pypi-publish)
To use, create a release on GitHub and the package will automatically appear on PyPI.
name: Publish to PyPI
on:
release: { types: [published] }
jobs:
deploy:
runs-on: ubuntu-latest
permissions: { id-token: write }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: python -m pip install build twine
- run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1Runs PyChase on its own code to detect any duplicate code within the project itself. This serves as both a dogfooding test and a quality gate.
- Runs
pychase --threshold 0.7 pychase/and outputs to the job summary - Generates an interactive HTML quality report
- Uploads the report as a build artifact
name: Scorecard
on:
push: { branches: [master] }
pull_request: { branches: [master] }
jobs:
analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: python -m pychase --threshold 0.7 pychase/
- run: python -m pychase --format html --output quality-report.html .
- uses: actions/upload-artifact@v4
with: { name: quality-report, path: quality-report.html }You don't need these workflows — PyChase is a standalone CLI tool. Add it to any CI pipeline:
# GitHub Actions
- run: pip install pychase
- run: pychase --json --threshold 0.85 ./src | tee results.json
- run: pychase --format html --output duplicates.html ./src
# GitLab CI
script:
- pip install pychase
- pychase --json --threshold 0.85 ./src > results.json
- pychase --format html --output duplicates.html ./srcShow your CI status in the README:

