Skip to content

Clean up logic for making fields nullable in v1, also clean up how te… #81

Clean up logic for making fields nullable in v1, also clean up how te…

Clean up logic for making fields nullable in v1, also clean up how te… #81

Workflow file for this run

name: CI/CD
on:
push:
pull_request:
jobs:
lint:
name: Lint code with black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
test:
name: Run unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.9"]
include:
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install json-schema-to-typescript
run: |
npm i -g json-schema-to-typescript
- name: Install python dependencies
run: |
python -m pip install -U pip wheel pytest pytest-cov coverage
python -m pip install -U .
- name: Run tests against 'pydantic@latest'
run: |
python -m pytest --cov=pydantic2ts --cov-append
- name: Run tests against 'pydantic==1.8.2'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
run: |
python -m pip install 'pydantic==1.8.2'
python -m pip install -U .
python -m pytest --cov=pydantic2ts --cov-append
- name: Combine coverage data
run: |
coverage combine
coverage report
- name: Generate LCOV File
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
run: |
coverage lcov -o coverage.lcov
- name: Coveralls
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
deploy:
name: Deploy to PyPi
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install -U pip wheel
- name: Build dist
run: |
python setup.py sdist bdist_wheel bdist_egg
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}