Skip to content

Gate tests/release behind pre-commit; use Python 3.14 #10

Gate tests/release behind pre-commit; use Python 3.14

Gate tests/release behind pre-commit; use Python 3.14 #10

Workflow file for this run

# 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