mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 02:45:34 +00:00
Set up pydantic-harness as a publishable Python package using hatchling, with CI (lint, test across Python 3.10-3.13) and automated PyPI releases on tag pushes via OIDC trusted publishing — mirroring pydantic-handlebars.
60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- '**'
|
|
pull_request: {}
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
- run: uv sync --frozen --all-groups
|
|
- run: make lint
|
|
- run: make typecheck
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- run: uv sync --frozen --all-groups
|
|
- run: make testcov
|
|
|
|
check:
|
|
if: always()
|
|
needs: [lint, test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: re-actors/alls-green@release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|
|
|
|
release:
|
|
needs: [check]
|
|
if: success() && startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
environment: release
|
|
permissions:
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
- uses: samuelcolvin/check-python-version@v4.1
|
|
id: check-python-version
|
|
with:
|
|
version_file_path: pyproject.toml
|
|
- run: uv build
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|