name: CI on: push: branches: - main pull_request: env: UV_VERSION: "0.11.21" # renovate: depName=uv datasource=pypi permissions: write-all concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: lint: env: SKIP: no-commit-to-branch runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.14" # renovate: depName=python datasource=python-version - uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2 # Make sure commit messages follow the conventional commits convention: # https://www.conventionalcommits.org commitlint: name: Lint Commit Messages runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 0 - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1 test: strategy: fail-fast: false matrix: python-version: - "3.12" - "3.13" - "3.14" # renovate: depName=python datasource=python-version os: - ubuntu-latest - windows-latest - macOS-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: ${{ matrix.python-version }} - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 with: version: ${{ env.UV_VERSION }} - name: Sync Dependencies run: uv sync --frozen --group dev shell: bash - name: Test with Pytest run: uv run pytest --cov-report=xml shell: bash - name: Upload coverage to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 with: token: ${{ secrets.CODECOV_TOKEN }} release: needs: - test - lint - commitlint runs-on: ubuntu-latest environment: release permissions: id-token: write contents: write steps: # Checkout must work for both PRs (including forks) and pushes to main - name: Checkout code uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 0 ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.14" # renovate: depName=python datasource=python-version # Do a dry run of PSR - name: Test release uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0 # v10.5.3 if: github.event_name == 'pull_request' with: no_operation_mode: true vcs_release: false push: false tag: false github_token: ${{ github.token }} # On main branch: actual PSR + upload to PyPI & GitHub - name: Release uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0 # v10.5.3 id: release if: github.event_name == 'push' && github.ref_name == 'main' with: verbosity: 2 # equivalent to "-vv" github_token: ${{ secrets.GITHUB_TOKEN }} - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 if: steps.release.outputs.released == 'true' with: packages-dir: dist - name: Publish package distributions to GitHub Releases uses: python-semantic-release/publish-action@310a9983a0ae878b29f3aac778d7c77c1db27378 # v10.5.3 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.release.outputs.tag }}