Skip to content

up

up #14

Workflow file for this run

name: Test
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
env:
COVERAGE_PYTHON_VERSION: '3.13'
COVERAGE_PYDANTIC_VERSION: '>=2.6'
jobs:
test:
name: Test
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest]
pydantic-version: ['>=1.10,<2', '>=2.6']
exclude:
- python-version: '3.14'
pydantic-version: '>=1.10,<2'
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: read
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
PYDANTIC_VERSION: ${{ matrix.pydantic-version }}
steps:
- name: Set up workspace
uses: lgc-NB2Dev/workspace/.github/actions/setup-workspace@main
with:
python-version: ${{ matrix.python-version }}
- name: Install Specific Version Pydantic (Bash)
shell: bash
run: uv add "pydantic$PYDANTIC_VERSION" "fastapi<0.119.0"
- name: Run pytest with coverage
working-directory: plugins/${{ github.event.repository.name }}
shell: bash
env:
PLUGIN_MODULE: ${{ github.event.repository.name }}
run: >-
uv run pytest
--cov="${PLUGIN_MODULE//-/_}"
--cov-branch
--cov-report=xml:coverage.xml
--cov-report=markdown-append:"$GITHUB_STEP_SUMMARY"
- name: Upload coverage to Codecov
if: >-
!cancelled() &&
matrix.python-version == env.COVERAGE_PYTHON_VERSION &&
matrix.pydantic-version == env.COVERAGE_PYDANTIC_VERSION
uses: codecov/codecov-action@v7
with:
disable_search: true
files: coverage.xml
flags: unit
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: plugins/${{ github.event.repository.name }}