Skip to content

Test

Test #217

Workflow file for this run

name: Test
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: 0 0 * * *
jobs:
test:
name: Test
strategy:
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
pydantic-version: [ "1.0", "2.0" ]
fail-fast: false
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Hatch Environment Variables
run: |
# Set the file extension based on the operating system
if [ ${{ matrix.os }} == "windows-latest" ]; then ext=".exe"; else ext=""; fi
echo "HATCH_ENV_TYPE_VIRTUAL_UV_PATH=$(which uv)$ext" >> $GITHUB_ENV
echo "HATCH_PYTHON=$(which python)$ext" >> $GITHUB_ENV
- name: Install Hatch
uses: pypa/hatch@install
- name: Install Pydantic
run: hatch run uv pip install pydantic~=${{ matrix.pydantic-version }}
- name: Run Build Hooks
run: hatch build --hooks-only
- name: Run Tests
run: hatch run test && hatch run coverage xml
- name: Coverage Results
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}