11name : Json2xml
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches : [main, master]
6+ paths-ignore :
7+ - ' docs/**'
8+ - ' *.md'
9+ - ' *.rst'
10+ pull_request :
11+ paths-ignore :
12+ - ' docs/**'
13+ - ' *.md'
14+ - ' *.rst'
415
516permissions :
617 contents : read
@@ -12,31 +23,27 @@ concurrency:
1223 cancel-in-progress : true
1324
1425jobs :
15- build :
26+ test :
1627 runs-on : ${{ matrix.os }}
1728 strategy :
1829 fail-fast : false
1930 matrix :
2031 python-version : [pypy-3.10, pypy-3.11, '3.10', '3.11', '3.12', '3.13']
21- tox-python-version : [pypy3.10, pypy3.11, py310, py311, py312, py313]
2232 os : [
2333 ubuntu-latest,
2434 windows-latest,
2535 macos-latest,
2636 ]
2737 include :
28- # Add exact version 3.14.0-alpha.0 for ubuntu-latest only
38+ # Add exact version 3.14.0-beta.1 for ubuntu-latest only
2939 - python-version : 3.14.0-beta.1
30- tox-python-version : py314-full
3140 os : ubuntu-latest
3241 exclude :
33- # Exclude other OSes with Python 3.14.0-alpha.0
42+ # Exclude other OSes with Python 3.14.0-beta.1
3443 - python-version : 3.14.0-beta.1
35- tox-python-version : py314-full
3644 os : windows-latest
3745 - python-version : 3.14.0-beta.1
3846 os : macos-latest
39- tox-python-version : py314-full
4047
4148 steps :
4249 - uses : actions/checkout@v4
@@ -48,27 +55,101 @@ jobs:
4855 with :
4956 python-version : ${{ matrix.python-version }}
5057 allow-prereleases : true
51- - name : install uv
52- uses : astral-sh/setup-uv@v3
58+
59+ - name : Install uv
60+ uses : astral-sh/setup-uv@v6
5361 with :
5462 enable-cache : true
55- cache-dependency-glob : requirements-dev.txt
63+ cache-dependency-glob : |
64+ requirements*.txt
65+ requirements-dev.in
66+ pyproject.toml
5667
5768 - name : Install dependencies
58- run : uv pip install --system tox tox-uv
69+ run : |
70+ uv pip install --system -e .
71+ uv pip install --system pytest pytest-xdist pytest-cov
5972
60- - name : Run tox targets for ${{ matrix.python-version }}
61- run : tox -e ${{matrix.tox-python-version}}
73+ - name : Create coverage directory
74+ run : mkdir -p coverage/reports
75+
76+ - name : Run tests
77+ run : |
78+ pytest --cov=json2xml --cov-report=xml:coverage/reports/coverage.xml --cov-report=term -xvs tests -n auto
79+ env :
80+ PYTHONPATH : ${{ github.workspace }}
6281
6382 - name : Upload coverage to Codecov
6483 uses : codecov/codecov-action@v5
84+ if : success()
6585 with :
6686 directory : ./coverage/reports/
6787 env_vars : OS,PYTHON
68- fail_ci_if_error : true
69- files : ./coverage.xml,./coverage2 .xml,!./cache
88+ fail_ci_if_error : false # Don't fail CI if codecov upload fails
89+ files : ./coverage/reports/coverage .xml
7090 flags : unittests
7191 token : ${{ secrets.CODECOV_TOKEN }}
7292 name : codecov-umbrella
7393 verbose : true
94+ env :
95+ OS : ${{ matrix.os }}
96+ PYTHON : ${{ matrix.python-version }}
97+
98+ lint :
99+ runs-on : ubuntu-latest
100+ steps :
101+ - uses : actions/checkout@v4
102+ with :
103+ persist-credentials : false
104+
105+ - name : Set up Python 3.12
106+ 107+ with :
108+ python-version : ' 3.12'
109+
110+ - name : Install uv
111+ uses : astral-sh/setup-uv@v6
112+ with :
113+ enable-cache : true
114+ cache-dependency-glob : |
115+ requirements*.txt
116+ requirements-dev.in
117+ pyproject.toml
118+
119+ - name : Install dependencies
120+ run : |
121+ uv pip install --system -e .
122+ uv pip install --system ruff>=0.3.0
123+
124+ - name : Run ruff
125+ run : ruff check json2xml tests
126+
127+ typecheck :
128+ runs-on : ubuntu-latest
129+ steps :
130+ - uses : actions/checkout@v4
131+ with :
132+ persist-credentials : false
133+
134+ - name : Set up Python 3.12
135+ 136+ with :
137+ python-version : ' 3.12'
138+
139+ - name : Install uv
140+ uses : astral-sh/setup-uv@v6
141+ with :
142+ enable-cache : true
143+ cache-dependency-glob : |
144+ requirements*.txt
145+ requirements-dev.in
146+ pyproject.toml
147+
148+ - name : Install dependencies
149+ run : |
150+ uv pip install --system -e .
151+ uv pip install --system mypy>=1.0.0 types-setuptools
152+
153+ - name : Run mypy
154+ run : mypy json2xml tests
74155
0 commit comments