Make 'module' and 'output' args required #89
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/CD | |
on: | |
push: | |
pull_request: | |
jobs: | |
lint: | |
name: Lint code with ruff | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/ruff-action@v1 | |
with: | |
src: ./pydantic2ts | |
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@v4 | |
- name: Set up Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
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: | | |
pytest --cov=pydantic2ts | |
- name: (3.9 ubuntu) 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 . | |
pytest --cov=pydantic2ts --cov-append | |
- name: (3.9 ubuntu) Generate LCOV File | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }} | |
run: | | |
coverage lcov | |
- name: (3.9 ubuntu) Upload to 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@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
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 }} |