chore(deps): update pre-commit hook commitizen-tools/commitizen to v4… #4658
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
| # Based on https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml | |
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Python | |
| on: [push, pull_request] | |
| jobs: | |
| # Adapted from https://github.com/marketplace/actions/skip-duplicate-actions | |
| pre_job: | |
| # continue-on-error: true # TODO: Uncomment once integration is finished | |
| runs-on: ubuntu-latest | |
| # Map a step output to a job output | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v5 | |
| with: | |
| # https://github.com/marketplace/actions/skip-duplicate-actions#skip-concurrent-workflow-runs | |
| concurrent_skipping: "same_content_newer" | |
| build: | |
| needs: pre_job | |
| # Always run the build step when pushing to master | |
| if: | |
| needs.pre_job.outputs.should_skip != 'true' || (github.event_name == 'push' | |
| && github.ref == 'refs/heads/master') | |
| name: "${{ matrix.name }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: lint | |
| os: ubuntu-latest | |
| toxenv: lint | |
| python-version: "3.14" | |
| - name: docs | |
| os: ubuntu-latest | |
| toxenv: docs | |
| python-version: "3.14" | |
| - name: test-ubuntu | |
| os: ubuntu-latest | |
| - name: test-windows | |
| os: windows-latest | |
| - name: test-macos | |
| os: macos-latest | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| PYTHONUNBUFFERED: 1 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Fetch full git history for git-revision-date-localized plugin | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| # For lint/docs jobs: install only the specified Python version | |
| - name: Install Python ${{ matrix.python-version }} | |
| if: matrix.python-version | |
| run: uv python install ${{ matrix.python-version }} | |
| # For test jobs: install all Python versions | |
| - name: Install Python 3.10, 3.11, 3.12, 3.13, 3.14 | |
| if: "!matrix.python-version" | |
| run: uv python install 3.10 3.11 3.12 3.13 3.14 | |
| # Cache tox environments | |
| - name: Cache tox environments | |
| uses: actions/cache@v4 | |
| # Caching step sometimes fail on test-macos: | |
| # Error: The template is not valid. .github/workflows/python.yaml (Line: 77, Col: 16): | |
| # hashFiles('**/tox.ini, **/pyproject.toml, **/uv.lock') failed. Fail to hash files | |
| # under directory '/Users/runner/work/nitpick/nitpick' | |
| # Maybe it's a race condition. | |
| # Let's ignore the error and don't use the cache. | |
| continue-on-error: true | |
| with: | |
| path: .tox | |
| # Include Python version in cache key to invalidate when Python versions are updated | |
| # No restore-keys to avoid using stale caches with incompatible Python versions | |
| key: ${{ runner.os }}-tox-${{ matrix.python-version || '3.10-3.11-3.12-3.13-3.14' }}-${{ hashFiles('**/tox.ini', '**/pyproject.toml', '**/uv.lock') }} | |
| - name: Install tox | |
| run: uv tool install tox | |
| # Install lychee for link checking in docs job | |
| # https://github.com/lycheeverse/lychee | |
| - name: Install lychee | |
| if: matrix.toxenv == 'docs' | |
| run: | | |
| curl -sSL https://github.com/lycheeverse/lychee/releases/latest/download/lychee-x86_64-unknown-linux-gnu.tar.gz | tar -xz | |
| sudo mv lychee /usr/local/bin/ | |
| lychee --version | |
| # Run tox environments | |
| # For test jobs: run all Python versions and generate coverage report | |
| # For lint/docs jobs: run only the specific environment | |
| - name: "Run tox" | |
| run: tox | |
| env: | |
| TOXENV: ${{ matrix.toxenv || 'py310,py311,py312,py313,py314,report' }} | |
| # https://github.com/codecov/codecov-action | |
| # Only upload coverage for test jobs (not lint/docs) | |
| - name: Upload coverage to Codecov | |
| if: "!matrix.toxenv" | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| flags: ${{ matrix.os }} | |
| name: ${{ matrix.os }} | |
| fail_ci_if_error: false | |
| files: ./coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} |