@@ -11,13 +11,13 @@ jobs:
1111 test :
1212 strategy :
1313 matrix :
14- python : [ "3.8 ", "3.9 ", "3.10 ", "3.11 ", "3.12 " ]
14+ python : [ "3.10 ", "3.11 ", "3.12 ", "3.13 ", "3.14 " ]
1515 os : [ ubuntu-latest, macos-latest, windows-latest ]
1616 runs-on : ${{ matrix.os }}
1717 steps :
18- - uses : actions/checkout@v4.1.3
18+ - uses : actions/checkout@v6.0.2
1919 - name : Set up Python
20- uses : actions/setup-python@v5.1 .0
20+ uses : actions/setup-python@v6.2 .0
2121 with :
2222 python-version : ${{ matrix.python }}
2323
2727 shell : bash
2828
2929 - name : Cache dependencies
30- uses : actions/cache@v4
30+ uses : actions/cache@v5
3131 with :
3232 path : .venv
3333 key : ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/pdm.lock') }}
4242 - name : Check formatting
4343 run : pdm run ruff format . --check
4444
45- - name : Run safety
46- run : pdm safety_check
47-
4845 - name : Run mypy
4946 run : pdm mypy --show-error-codes
5047
@@ -54,37 +51,70 @@ jobs:
5451 - name : Run pytest without coverage
5552 if : matrix.os != 'ubuntu-latest'
5653 run : pdm test
57- env :
58- TASKIPY : true
5954
6055 - name : Run pytest with coverage
6156 if : matrix.os == 'ubuntu-latest'
6257 run : pdm test_with_coverage
63- env :
64- TASKIPY : true
65-
58+
6659 - run : mv .coverage .coverage.${{ matrix.python }}
6760 if : matrix.os == 'ubuntu-latest'
6861
6962 - name : Store coverage report
70- uses : actions/upload-artifact@v4.3.3
63+ uses : actions/upload-artifact@v7.0.1
7164 if : matrix.os == 'ubuntu-latest'
7265 with :
7366 name : coverage-${{ matrix.python }}
7467 path : .coverage.${{ matrix.python }}
7568 if-no-files-found : error
69+ include-hidden-files : true
70+
71+ test_min_deps :
72+ strategy :
73+ matrix :
74+ os : [ ubuntu-latest, macos-latest, windows-latest ]
75+ runs-on : ${{ matrix.os }}
76+ steps :
77+ - uses : actions/checkout@v6.0.2
78+ - name : Set up Python
79+ uses : actions/setup-python@v6.2.0
80+ with :
81+ python-version : " 3.10"
82+
83+ - name : Get Python Version
84+ id : get_python_version
85+ run : echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
86+ shell : bash
87+
88+ - name : Cache dependencies
89+ uses : actions/cache@v5
90+ with :
91+ path : .venv
92+ key : ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-min-dependencies-${{ hashFiles('**/pdm.lock') }}
93+ restore-keys : |
94+ ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-min-dependencies
95+ - name : Install PDM
96+ run : pip install pdm
97+
98+ - name : Install minimum dependencies
99+ run : pdm install -L pdm.minimal.lock
100+
101+ - name : Run mypy
102+ run : pdm mypy --show-error-codes
103+
104+ - name : Run unit tests only # snapshots are expected to fail
105+ run : pdm unit_test
76106
77107 coverage :
78108 name : Combine & check coverage
79109 needs : test
80110 runs-on : ubuntu-latest
81111 steps :
82- - uses : actions/checkout@v4.1.3
83- - uses : actions/setup-python@v5
112+ - uses : actions/checkout@v6.0.2
113+ - uses : actions/setup-python@v6
84114 with :
85115 python-version : " 3.12"
86116 - name : Download coverage reports
87- uses : actions/download-artifact@v4.1.6
117+ uses : actions/download-artifact@v8.0.1
88118 with :
89119 merge-multiple : true
90120
@@ -98,18 +128,18 @@ jobs:
98128
99129 # Find all of the downloaded coverage reports and combine them
100130 .venv/bin/python -m coverage combine
101-
131+
102132 # Create html report
103133 .venv/bin/python -m coverage html --skip-covered --skip-empty
104-
134+
105135 # Report in Markdown and write to summary.
106136 .venv/bin/python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
107-
137+
108138 # Report again and fail if under 100%.
109- .venv/bin/python -m coverage report --fail-under=100
139+ .venv/bin/python -m coverage report --fail-under=100
110140
111141 - name : Upload HTML report if check failed.
112- uses : actions/upload-artifact@v4.3.3
142+ uses : actions/upload-artifact@v7.0.1
113143 with :
114144 name : html-report
115145 path : htmlcov
@@ -120,51 +150,35 @@ jobs:
120150 runs-on : ubuntu-latest
121151 strategy :
122152 matrix :
123- httpx_version :
124- - " 0.20.0 "
125- - " "
153+ lockfile :
154+ - " pdm.lock "
155+ - " pdm.minimal.lock "
126156 services :
127157 openapi-test-server :
128- image : ghcr.io/openapi-generators/openapi-test-server:0.0 .1
158+ image : ghcr.io/openapi-generators/openapi-test-server:0.2 .1
129159 ports :
130160 - " 3000:3000"
131161 steps :
132- - uses : actions/checkout@v4.1.3
162+ - uses : actions/checkout@v6.0.2
133163 - name : Set up Python
134- uses : actions/setup-python@v5.1 .0
164+ uses : actions/setup-python@v6.2 .0
135165 with :
136- python-version : " 3.8 "
166+ python-version : " 3.10 "
137167 - name : Get Python Version
138168 id : get_python_version
139169 run : echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
140- - name : Cache dependencies
141- uses : actions/cache@v4
142- with :
143- path : .venv
144- key : ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/pdm.lock') }}
145- restore-keys : |
146- ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies
147- - name : Install dependencies
148- run : |
149- pip install pdm
150- python -m venv .venv
151- pdm install
152170 - name : Cache Generated Client Dependencies
153- uses : actions/cache@v4
171+ uses : actions/cache@v5
154172 with :
155173 path : integration-tests/.venv
156- key : ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('** /pdm.lock') }}
174+ key : ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies-${{ hashFiles('integration-tests /pdm* .lock') }}
157175 restore-keys : |
158176 ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-integration-dependencies
159- - name : Set httpx version
160- if : matrix.httpx_version != ''
161- run : |
162- cd integration-tests
163- pdm add httpx==${{ matrix.httpx_version }}
164177 - name : Install Integration Dependencies
165178 run : |
166179 cd integration-tests
167- pdm install
180+ pip install pdm
181+ pdm install -L ${{ matrix.lockfile }}
168182 - name : Run Tests
169183 run : |
170184 cd integration-tests
0 commit comments