Skip to content

truly support pydantic v2 without shims #4163

truly support pydantic v2 without shims

truly support pydantic v2 without shims #4163

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- main
merge_group:
branches:
- main
types:
- checks_requested
jobs:
test-go:
name: "Test Go"
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
platform: [ubuntu-latest-8-cores, macos-12]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
- name: Build
run: make cog
- name: Lint
run: make lint-go
- name: Test
run: make test-go
test-python:
name: "Test Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
- name: Test
run: make test-python
env:
HYPOTHESIS_PROFILE: ci
typecheck-python:
name: "Typecheck and lint Python"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
- name: Run typechecking
run: |
make lint-python
# cannot run this on mac due to licensing issues: https://github.com/actions/virtual-environments/issues/2150
test-integration:
name: "Test integration"
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
- name: Test
run: make test-integration
release:
needs:
- test-go
- test-python
- test-integration
if: startsWith(github.ref, 'refs/tags/v')
outputs:
cog_version: ${{ steps.build-python-package.outputs.version }}
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: make cog
- uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Python package
id: build-python-package
run: |
# clean package built for go client
rm -rf dist
# install build
pip install build
# build package
python -m build --wheel
# set output
echo "version=$(ls dist/ | cut -d- -f2)" >> $GITHUB_OUTPUT
- name: Push Python package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: dist