Gate tests/release behind pre-commit; use Python 3.14 #10
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
| # 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: Run tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: '3.14' | |
| - run: uvx pre-commit run --all-files --show-diff-on-failure | |
| tests: | |
| needs: [ pre-commit ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ "3.11", "3.12", "3.13", "3.14" ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Test with pytest | |
| run: uv run pytest | |
| release: | |
| needs: [ tests ] | |
| if: success() && startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-24.04 | |
| environment: release | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: '3.14' | |
| - name: Build | |
| run: uv build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |