Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Emit warning when field-specific metadata is used in invalid contexts…#1444
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
name:Publish Documentation | |
on: | |
push: | |
branches: | |
-main | |
-docs-update | |
tags: | |
-'**' | |
concurrency: | |
group:${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress:true | |
env: | |
COLUMNS:150 | |
UV_FROZEN:true | |
jobs: | |
lint: | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v4 | |
-uses:astral-sh/setup-uv@v6 | |
with: | |
python-version:'3.12' | |
-name:Install dependencies | |
# Installing pip is required for the pre-commit action: | |
run:| | |
uv sync --group linting --all-extras | |
uv pip install pip | |
-uses:pre-commit/action@v3.0.1 | |
with: | |
extra_args:--all-files --verbose | |
env: | |
SKIP:no-commit-to-branch | |
test: | |
runs-on:ubuntu-latest | |
steps: | |
-uses:actions/checkout@v4 | |
-uses:astral-sh/setup-uv@v6 | |
with: | |
python-version:'3.12' | |
-name:Install dependencies | |
run:uv sync --group testing-extra --all-extras | |
-run:'uv run python -c "import pydantic.version; print(pydantic.version.version_info())"' | |
-run:make test | |
publish: | |
# Compare with the docs-build job in .github/workflows/ci.yml | |
needs:[lint, test] | |
runs-on:ubuntu-latest | |
timeout-minutes:30 | |
steps: | |
-name:Checkout docs-site | |
uses:actions/checkout@v4 | |
with: | |
ref:docs-site | |
-name:Checkout current branch | |
uses:actions/checkout@v4 | |
-uses:astral-sh/setup-uv@v6 | |
with: | |
python-version:'3.12' | |
-run:uv sync --group docs --group docs-upload | |
-run:uv pip install --default-index https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ mkdocs-material | |
env: | |
PPPR_TOKEN:${{ secrets.PPPR_TOKEN }} | |
-run:uv run python -c 'import docs.plugins.main' | |
# Taken from docs-build.sh | |
-name:Prepare shortcuts for extra modules | |
run:| | |
ln -s .venv/lib/python*/site-packages/pydantic_core pydantic_core | |
ln -s .venv/lib/python*/site-packages/pydantic_settings pydantic_settings | |
ln -s .venv/lib/python*/site-packages/pydantic_extra_types pydantic_extra_types | |
-name:Set git credentials | |
run:| | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
-run:PYTHONPATH="$PWD${PYTHONPATH:+:${PYTHONPATH}}" uv run mike deploy -b docs-site dev --push | |
if:github.ref == 'refs/heads/main' | |
-if:github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/') | |
id:check-version | |
uses:samuelcolvin/check-python-version@v4.1 | |
with: | |
version_file_path:'pydantic/version.py' | |
skip_env_check:true | |
-run:PYTHONPATH="$PWD${PYTHONPATH:+:${PYTHONPATH}}" uv run mike deploy -b docs-site ${{ steps.check-version.outputs.VERSION_MAJOR_MINOR }} latest --update-aliases --push | |
if:${{ (github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')) && !fromJSON(steps.check-version.outputs.IS_PRERELEASE) }} | |
env: | |
PYDANTIC_VERSION:v${{ steps.check-version.outputs.VERSION }} | |
-run:uv run python docs/plugins/algolia.py upload | |
env: | |
ALGOLIA_WRITE_API_KEY:${{ secrets.ALGOLIA_WRITE_API_KEY }} |