1313 FORCE_COLOR : " 3"
1414 UVX_CONSTRAINT : requirements/lock/uvx-tools.txt
1515 UVX_COMMAND : uvx -crequirements/lock/uvx-tools.txt
16+ EXTRA_PYTHON_VERSIONS : " pypy-3.11"
1617
1718permissions : {}
1819
1920jobs :
21+ pre_job :
22+ # continue-on-error: true # Uncomment once integration is finished
23+ runs-on : ubuntu-latest
24+ outputs :
25+ should_skip : ${{ steps.skip_check.outputs.should_skip }}
26+ steps :
27+ - id : skip_check
28+ uses : fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
29+
2030 build-package :
2131 name : Build & verify package
32+ needs : pre_job
33+ if : needs.pre_job.outputs.should_skip != 'true'
2234 runs-on : ubuntu-latest
23-
2435 steps :
2536 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2637 with :
2738 persist-credentials : false
28-
2939 - uses : hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0
3040 id : baipp
3141
@@ -40,26 +50,48 @@ jobs:
4050 import json
4151 from pathlib import Path
4252
43- python_versions = json.loads(os.getenv("python_classifiers"))
4453 default_python_version = Path(".python-version").read_text().strip()
54+ python_versions = json.loads(os.getenv("python_classifiers"))
55+ extra_python_versions = [_.strip() for _ in os.getenv("EXTRA_PYTHON_VERSIONS", "").split(",")]
56+
57+ min_python_version = python_versions[0]
58+ max_python_version = python_versions[-1]
59+ minmax_python_versions = [min_python_version, max_python_version, *extra_python_versions]
60+ minmax_default_python_versions = list({*minmax_python_versions, default_python_version})
61+ all_python_versions = list({*python_versions, *extra_python_versions})
62+
63+ print("{default_python_version=:s}")
64+ print("{min_python_version=:s}")
65+ print("{max_python_version=:s}")
66+ print("{minmax_python_versions=}")
67+ print("{minmax_default_python_versions=}")
68+ print("{all_python_version=}")
4569
46- # min max and default pythons
47- matrix_test_python = list({ python_versions[0], python_versions[-1], default_python_version, f"pypy-3.11" })
4870
4971 with open(os.getenv("GITHUB_OUTPUT"), "a") as f:
5072 f.write(f"{default_python_version=:s}\n")
51- f.write(f"matrix_test_python={json.dumps(matrix_test_python)}\n")
73+ f.write(f"{min_python_version=:s}\n")
74+ f.write(f"{max_python_version=:s}\n")
75+ f.write(f"minmax_python_versions={json.dumps(minmax_python_versions)}\n")
76+ f.write(f"minmax_default_python_versions={json.dumps(minmax_default_python_versions)}\n")
77+ f.write(f"all_python_versions={json.dumps(all_python_versions)}\n")
5278
5379 outputs :
54- supported-python-versions :
55- ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
5680 default-python-version :
5781 ${{ steps.versions.outputs.default_python_version }}
58- matrix-test-python : ${{ steps.versions.outputs.matrix_test_python }}
82+ min-python-version : ${{ steps.versions.outputs.min_python_version }}
83+ max-python-version : ${{ steps.versions.outputs.max_python_version }}
84+ minmax-python-versions :
85+ ${{ steps.versions.outputs.minmax_python_versions }}
86+ minmax-default-python-versions :
87+ ${{ steps.versions.outputs.minmax_default_python_versions }}
88+ all-python-version : ${{ steps.versions.outputs.all_python_versions }}
5989
6090 lint :
6191 # only run checks not covered by pre-commit.ci
6292 name : Lint package
93+ needs : pre_job
94+ if : needs.pre_job.outputs.should_skip != 'true'
6395 runs-on : ubuntu-latest
6496 steps :
6597 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -92,14 +124,37 @@ jobs:
92124 prek run --show-diff-on-failure --color=always --all-files
93125 --hook-stage=manual -v
94126
127+ pinact :
128+ name : Pin actions
129+ needs : pre_job
130+ if : needs.pre_job.outputs.should_skip != 'true'
131+ runs-on : ubuntu-latest
132+ permissions :
133+ contents : write
134+ steps :
135+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
136+ with :
137+ persist-credentials : false
138+
139+ - name : Pin actions
140+ uses : suzuki-shunsuke/pinact-action@1081f5ad49ac904b7d977784f338145150a32112 # v1.4.0
141+ with :
142+ skip_push : " true"
143+
95144 typecheck :
96145 name : Typecheck package
146+ needs : pre_job
147+ if : needs.pre_job.outputs.should_skip != 'true'
97148 runs-on : ${{ matrix.os }}
98149 strategy :
99150 fail-fast : false
100151 matrix :
101152 os :
102153 - ubuntu-latest
154+ <<<<<<< before updating
155+ =======
156+ # - windows-latest
157+ >>>>>>> after updating
103158 steps :
104159 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105160 with :
@@ -121,15 +176,20 @@ jobs:
121176
122177 test :
123178 name : Test package across pythons
124- needs : build-package
179+ needs :
180+ - pre_job
181+ - build-package
182+ if : needs.pre_job.outputs.should_skip != 'true'
125183 runs-on : ${{ matrix.os }}
126184 strategy :
127185 fail-fast : false
128186 matrix :
129187 os :
130188 - ubuntu-latest
131189 python-version :
132- ${{ fromJson(needs.build-package.outputs.matrix-test-python) }}
190+ ${{
191+ fromJson(needs.build-package.outputs.minmax-default-python-versions)
192+ }}
133193 include :
134194 - os : windows-latest
135195 python-version :
@@ -155,7 +215,7 @@ jobs:
155215 shell : bash
156216
157217 - name : Upload coverage data
158- uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 .0.0
218+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 .0.0
159219 with :
160220 name : coverage-data-${{ matrix.os }}-${{ matrix.python-version }}
161221 path : .nox/test-*/tmp/.coverage*
@@ -164,7 +224,10 @@ jobs:
164224
165225 coverage :
166226 name : Combine coverage
167- needs : test
227+ needs :
228+ - pre_job
229+ - test
230+ if : needs.pre_job.outputs.should_skip != 'true'
168231 runs-on : ubuntu-latest
169232
170233 steps :
@@ -194,47 +257,36 @@ jobs:
194257 $UVX_COMMAND nox -s coverage -- ++coverage report ++coverage-options --fail-under=100
195258 shell : bash
196259 - name : Upload HTML report if check failed.
197- uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 .0.0
260+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 .0.0
198261 with :
199262 name : html-report
200263 path : htmlcov
201264 if : ${{ failure() }}
202265
203266 docs :
267+ needs : pre_job
268+ if : needs.pre_job.outputs.should_skip != 'true'
204269 permissions :
205270 contents : write
206271 uses : ./.github/workflows/docs.yml
207272 with :
208273 deploy : false
209274
210- pinact :
211- name : Pin actions
212- runs-on : ubuntu-latest
213- permissions :
214- contents : write
215- steps :
216- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
217- with :
218- persist-credentials : false
219-
220- - name : Pin actions
221- uses : suzuki-shunsuke/pinact-action@1081f5ad49ac904b7d977784f338145150a32112 # v1.4.0
222- with :
223- skip_push : " true"
224-
225275 # Ensure everything required is passing for branch protection.
226276 required-checks-pass :
227277 if : always()
228278 needs :
279+ - pre_job
229280 - lint
281+ - pinact
230282 - typecheck
231283 - test
232284 - coverage
233- - pinact
234285 - docs
235286 runs-on : ubuntu-latest
236287 steps :
237288 - name : Decide whether the needed jobs succeeded or failed
238289 uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
239290 with :
291+ allowed-skips : " lint,pinact,typecheck,test,coverage,docs"
240292 jobs : ${{ toJSON(needs) }}
0 commit comments