Use pydantic instead deserializer #13
This file contains 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: Test, build and create releases. | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test project | |
strategy: | |
matrix: | |
os: | |
- "windows-latest" | |
- "ubuntu-latest" | |
- "macos-latest" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pdm | |
uses: pdm-project/setup-pdm@v4 | |
- name: Install dependencies | |
run: pdm install --dev ${{ matrix.os != 'windows-latest' && '--group=uvloop' || '' }} | |
- name: Test project | |
run: pdm run pytest | |
build-and-release: | |
name: Build project and release if needed | |
runs-on: "ubuntu-latest" | |
needs: "test" | |
permissions: | |
contents: "write" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pdm | |
uses: pdm-project/setup-pdm@v4 | |
- name: Install dependencies | |
run: pdm install --dev --group=uvloop | |
- name: Build project | |
run: pdm build | |
- name: Release | |
if: github.ref_type == 'tag' | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "dist/*" | |
generate_release_notes: true | |
fail_on_unmatched_files: true |