mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 02:45:34 +00:00
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
tags:
|
||
- '**'
|
||
pull_request: {}
|
||
|
||
env:
|
||
UV_FROZEN: '1'
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
jobs:
|
||
lint:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||
with:
|
||
python-version: ${{ matrix.python-version }}
|
||
enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions
|
||
|
||
- 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.12', '3.13']
|
||
steps:
|
||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||
with:
|
||
python-version: ${{ matrix.python-version }}
|
||
enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions
|
||
|
||
- 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@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
|
||
with:
|
||
jobs: ${{ toJSON(needs) }}
|
||
|
||
release:
|
||
needs: [check]
|
||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||
runs-on: ubuntu-latest
|
||
environment: release
|
||
permissions:
|
||
contents: read
|
||
id-token: write
|
||
steps:
|
||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||
with:
|
||
python-version: '3.13'
|
||
enable-cache: false
|
||
|
||
- run: uv build
|
||
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
|