33 push :
44 branches : [main]
55 pull_request :
6+ types :
7+ - opened
8+ - synchronize
9+ - reopened
10+ - ready_for_review
611 workflow_dispatch :
712
813concurrency :
1318 FORCE_COLOR : " 3"
1419 UVX_CONSTRAINT : requirements/lock/uvx-tools.txt
1520 UVX_COMMAND : uvx -crequirements/lock/uvx-tools.txt
21+ NOX_COMMAND : uvx -crequirements/lock/uvx-tools.txt nox
1622 EXTRA_PYTHON_VERSIONS : " pypy-3.11"
1723
1824permissions : {}
2430 outputs :
2531 should_skip : ${{ steps.skip_check.outputs.should_skip }}
2632 steps :
33+ - name : Don't run CI on draft PR
34+ if :
35+ github.event_name == 'pull_request' && github.event.pull_request.draft
36+ == true
37+ run : exit 1
38+
2739 - id : skip_check
2840 uses : fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
2941 with :
6981 print("{minmax_default_python_versions=}")
7082 print("{all_python_version=}")
7183
72-
7384 with open(os.getenv("GITHUB_OUTPUT"), "a") as f:
7485 f.write(f"{default_python_version=:s}\n")
7586 f.write(f"{min_python_version=:s}\n")
@@ -153,6 +164,9 @@ jobs:
153164 matrix :
154165 os :
155166 - ubuntu-latest
167+ # - windows-latest
168+ session :
169+ - typecheck
156170 steps :
157171 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
158172 with :
@@ -162,14 +176,16 @@ jobs:
162176 python-version-file : " .python-version"
163177 cache-dependency-path : uv.lock
164178 - name : Get python version
179+ id : python_version
165180 run : |
166181 python_version=$(cat .python-version)
167- echo "python_version=${python_version}" >> "$GITHUB_ENV "
182+ echo "python_version=${python_version}" >> "$GITHUB_OUTPUT "
168183 shell : bash
169184 - name : typecheck
170185 env :
171- python_version : ${{ env.python_version }}
172- run : $UVX_COMMAND nox -s typecheck-"$python_version"
186+ python_version : ${{ steps.python_version.outputs.python_version }}
187+ session : ${{ matrix.session }}
188+ run : $NOX_COMMAND -s "${session}-${python_version}"
173189 shell : bash
174190
175191 test :
@@ -188,10 +204,13 @@ jobs:
188204 ${{
189205 fromJson(needs.build-package.outputs.minmax-default-python-versions)
190206 }}
207+ session :
208+ - test
191209 include :
192210 - os : windows-latest
193211 python-version :
194212 ${{ needs.build-package.outputs.default-python-version }}
213+ session : test
195214 steps :
196215 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
197216 with :
@@ -208,14 +227,19 @@ jobs:
208227 - name : Test with nox
209228 env :
210229 python_version : ${{ matrix.python-version }}
211- run : >-
212- $UVX_COMMAND nox -s test-"$python_version" -- ++installpkg dist/*.whl
213- shell : bash
230+ options : " ++installpkg dist/*.whl"
231+ session : ${{ matrix.session }}
232+ run : |
233+ # shellcheck disable=SC2086
234+ $NOX_COMMAND -s "${session}-${python_version}" -- $options
235+ shell : bash -euxo pipefail {0}
214236
215237 - name : Upload coverage data
216238 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
217239 with :
218- name : coverage-data-${{ matrix.os }}-${{ matrix.python-version }}
240+ name :
241+ coverage-data-${{ matrix.os }}-${{ matrix.python-version }}-${{
242+ matrix.session }}
219243 path : .nox/test-*/tmp/.coverage*
220244 include-hidden-files : true
221245 if-no-files-found : ignore
@@ -247,12 +271,12 @@ jobs:
247271 cache-dependency-path : requirements/lock/uvx-tools.txt
248272 - name : Run coverage
249273 run : |
250- $UVX_COMMAND nox -s coverage -- ++coverage combine html markdown
274+ $NOX_COMMAND -s coverage -- ++coverage combine html markdown
251275 cat coverage.md
252276 cat coverage.md >> "$GITHUB_STEP_SUMMARY"
253277
254278 # fail if under 100%
255- $UVX_COMMAND nox -s coverage -- ++coverage report ++coverage-options --fail-under=100
279+ $NOX_COMMAND -s coverage -- ++coverage report ++coverage-options --fail-under=100
256280 shell : bash
257281 - name : Upload HTML report if check failed.
258282 uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
0 commit comments