From 6bf82dee03d1d551af72a1d07b9ee5f3ede72ed7 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 5 Jan 2026 23:22:30 +0800 Subject: [PATCH 1/3] ci: run unittests only on python and dependency change --- .github/workflows/pythonpackage.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index cdf0d1d17..e26383bbf 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -8,25 +8,50 @@ on: workflow_dispatch: jobs: + detect_changes: + runs-on: ubuntu-latest + outputs: + relevant: ${{ steps.filter.outputs.relevant }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + relevant: + - "commitizen/**" + - "tests/**" + - ".github/workflows/**" python-check: + needs: detect_changes strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] platform: [ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: + - name: No relevant changes, fast-path success + if: ${{ needs.detect_changes.outputs.relevant != 'true' }} + run: echo "No relevant file changes; skipping tests and linters." + - uses: actions/checkout@v6 + if: ${{ needs.detect_changes.outputs.relevant == 'true' }} with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 + if: ${{ needs.detect_changes.outputs.relevant == 'true' }} with: python-version: ${{ matrix.python-version }} - name: Install dependencies + if: ${{ needs.detect_changes.outputs.relevant == 'true' }} run: | uv --version uv sync --frozen --group base --group test --group linters - name: Run tests and linters + if: ${{ needs.detect_changes.outputs.relevant == 'true' }} run: | git config --global user.email "action@github.com" git config --global user.name "GitHub Action" @@ -34,11 +59,12 @@ jobs: shell: bash - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 + if: ${{ needs.detect_changes.outputs.relevant == 'true' }} with: token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to Codecov uses: codecov/codecov-action@v5 - if: ${{ !cancelled() }} + if: ${{ needs.detect_changes.outputs.relevant == 'true' && !cancelled() }} with: token: ${{ secrets.CODECOV_TOKEN }} report_type: test_results From e473e205e544344a70bc9ed8b27a5d57d4c8ab49 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Tue, 6 Jan 2026 19:13:02 +0800 Subject: [PATCH 2/3] ci: wip --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e26383bbf..1b93a0c29 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -23,7 +23,7 @@ jobs: relevant: - "commitizen/**" - "tests/**" - - ".github/workflows/**" + # - ".github/workflows/**" python-check: needs: detect_changes strategy: From a055a5b6653eaa65697c8bc15564676102e1bb14 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Tue, 6 Jan 2026 19:19:07 +0800 Subject: [PATCH 3/3] fix: wip --- commitizen/commands/init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commitizen/commands/init.py b/commitizen/commands/init.py index 62678a224..083c6a65c 100644 --- a/commitizen/commands/init.py +++ b/commitizen/commands/init.py @@ -78,7 +78,9 @@ def __init__(self, config: BaseConfig, *args: object) -> None: def __call__(self) -> None: if self.config.path: - out.line(f"Config file {self.config.path} already exists") + out.line( + f"Config file {self.config.path} already exists." + ) # Check if the change triggers the pipeline return out.info("Welcome to commitizen!\n")