4
4
pull_request :
5
5
jobs :
6
6
lint :
7
- name : Lint code with black
7
+ name : Lint code with ruff
8
8
runs-on : ubuntu-latest
9
9
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
12
14
test :
13
15
name : Run unit tests
14
16
needs : lint
15
17
runs-on : ${{ matrix.os }}
16
18
strategy :
17
19
matrix :
18
20
os : [ubuntu-latest, windows-latest, macOS-latest]
19
- python-version : ["3.8 "]
21
+ python-version : ["3.9 "]
20
22
include :
21
23
- os : ubuntu-latest
22
- python-version : " 3.6 "
24
+ python-version : " 3.8 "
23
25
- os : ubuntu-latest
24
- python-version : " 3.7 "
26
+ python-version : " 3.10 "
25
27
- os : ubuntu-latest
26
- python-version : " 3.9 "
28
+ python-version : " 3.11 "
27
29
- os : ubuntu-latest
28
- python-version : " 3.10"
30
+ python-version : " 3.12"
31
+ - os : ubuntu-latest
32
+ python-version : " 3.13"
29
33
steps :
30
34
- 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
38
38
with :
39
- python -version : ${{ matrix.python-version }}
39
+ node -version : 20
40
40
- 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'
41
47
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' }}
52
53
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
57
60
with :
58
61
github-token : ${{ secrets.GITHUB_TOKEN }}
59
62
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
63
65
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
64
66
needs : test
67
+ runs-on : ubuntu-latest
65
68
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
69
73
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
-
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
79
97
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