Migrated pydantic v1 API to v2 API for compliance and warning reducti… #314
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: | |
| - published | |
| env: | |
| MINIMUM_PYTHON_VERSION: '3.10' | |
| jobs: | |
| precommit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | |
| - name: Run static code inspections | |
| run: uv run pre-commit run --all-files | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Test with uv | |
| run: | | |
| uv run pytest --cov-branch --cov-report term-missing --cov=tests/ --cov=midom/ | |
| deploy: | |
| if: github.event_name == 'release' | |
| needs: [precommit, build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | |
| - name: Upload to pypi | |
| env: | |
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| uv build | |
| uv publish |