44 pull_request :
55jobs :
66 lint :
7- name : Lint code with black
7+ name : Lint code with ruff
88 runs-on : ubuntu-latest
99 steps :
10- - uses : actions/checkout@v2
11- - uses : psf/black@stable
10+ - uses : actions/checkout@v4
11+ - uses : astral-sh/ruff-action@v1
12+ with :
13+ src : ./pydantic2ts
1214 test :
1315 name : Run unit tests
1416 needs : lint
1517 runs-on : ${{ matrix.os }}
1618 strategy :
1719 matrix :
1820 os : [ubuntu-latest, windows-latest, macOS-latest]
19- python-version : ["3.8 "]
21+ python-version : ["3.9 "]
2022 include :
2123 - os : ubuntu-latest
22- python-version : " 3.6 "
24+ python-version : " 3.8 "
2325 - os : ubuntu-latest
24- python-version : " 3.7 "
26+ python-version : " 3.10 "
2527 - os : ubuntu-latest
26- python-version : " 3.9 "
28+ python-version : " 3.11 "
2729 - os : ubuntu-latest
28- python-version : " 3.10"
30+ python-version : " 3.12"
31+ - os : ubuntu-latest
32+ python-version : " 3.13"
2933 steps :
3034 - name : Check out repo
31- uses : actions/checkout@v3
32- - name : Set up Node.js 16
33- uses : actions/setup-node@v3
34- with :
35- node-version : 16
36- - name : Set up Python ${{ matrix.python-version }}
37- uses : actions/setup-python@v4
35+ uses : actions/checkout@v4
36+ - name : Install node
37+ uses : actions/setup-node@v4
3838 with :
39- python -version : ${{ matrix.python-version }}
39+ node -version : 20
4040 - name : Install json-schema-to-typescript
41+ run : npm i -g json-schema-to-typescript
42+ - name : Install uv
43+ uses : astral-sh/setup-uv@v3
44+ with :
45+ version : " 0.5.2"
46+ - name : Run tests against 'pydantic@latest'
4147 run : |
42- npm i -g json-schema-to-typescript
43- - name : Install python dependencies
44- run : |
45- python -m pip install -U pip wheel pytest pytest-cov coverage
46- python -m pip install -U .
47- - name : Run tests
48- run : |
49- python -m pytest --cov=pydantic2ts
50- - name : Generate LCOV File
51- if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
48+ uv python install ${{ matrix.python-version }}
49+ uv sync --all-extras --dev
50+ uv run pytest --cov=pydantic2ts
51+ - name : (ubuntu 3.9) Run tests against 'pydantic==1.8.2' and generate an LCOV file for Coveralls
52+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
5253 run : |
53- coverage lcov
54- - name : Coveralls
55- if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
56- uses : coverallsapp/github-action@master
54+ uv add 'pydantic==1.8.2'
55+ uv run pytest --cov=pydantic2ts --cov-append
56+ uv run coverage lcov
57+ - name : (ubuntu 3.9) Upload to Coveralls
58+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
59+ uses : coverallsapp/github-action@v2
5760 with :
5861 github-token : ${{ secrets.GITHUB_TOKEN }}
5962 path-to-lcov : coverage.lcov
60- deploy :
61- name : Deploy to PyPi
62- runs-on : ubuntu-latest
63+ build :
64+ name : Build pydantic2ts for distribution
6365 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
6466 needs : test
67+ runs-on : ubuntu-latest
6568 steps :
66- - uses : actions/checkout@v3
67- - name : Set up Python 3.8
68- uses : actions/setup-python@v4
69+ - name : Check out repo
70+ uses : actions/checkout@v4
71+ - name : Install uv
72+ uses : astral-sh/setup-uv@v3
6973 with :
70- python-version : 3.8
71- - name : Install dependencies
72- run : |
73- python -m pip install -U pip wheel
74- - name : Build dist
75- run : |
76- python setup.py sdist bdist_wheel bdist_egg
77- - name : Publish package
78- uses : pypa/gh-action-pypi-publish@v1.5.0
74+ version : " 0.5.2"
75+ - name : Install python 3.9
76+ run : uv python install 3.9
77+ - name : Build pydantic2ts
78+ run : uv build
79+ - name : Store the distribution
80+ uses : actions/upload-artifact@v4
81+ with :
82+ name : pydantic2ts-dist
83+ path : dist/
84+ publish-to-pypi :
85+ name : Publish pydantic2ts to PyPI
86+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
87+ needs : build
88+ runs-on : ubuntu-latest
89+ environment :
90+ name : pypi
91+ url : https://pypi.org/p/pydantic-to-typescript
92+ permissions :
93+ id-token : write
94+ steps :
95+ - name : Download all the dists
96+ uses : actions/download-artifact@v4
7997 with :
80- user : __token__
81- password : ${{ secrets.pypi_password }}
98+ name : pydantic2ts-dist
99+ path : dist/
100+ - name : Publish distributions to PyPI
101+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments