Skip to content

Commit 7d569d3

Browse files
wpk-nist-govgithub-actions[bot]
authored andcommitted
chore(template): accept new copier update
1 parent a9bcfa5 commit 7d569d3

6 files changed

Lines changed: 203 additions & 51 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v0.7.0-109-g667a118
2+
_commit: v0.7.0-127-gf28b4dc
33
_src_path: https://github.com/usnistgov/cookiecutter-nist-python.git
44
command_line_interface: typer
55
conda_channel: conda-forge

.github/workflows/cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jobs:
8484
smoke-test:
8585
name: Smoke test package
8686
if:
87-
${{ (github.event_name == 'release' && github.event.action == 'published')
88-
|| (github.event_name == 'workflow_dispatch' && inputs.deploy) }}
87+
(github.event_name == 'release' && github.event.action == 'published') ||
88+
(github.event_name == 'workflow_dispatch' && inputs.deploy)
8989
needs:
9090
- dist
9191
runs-on: ubuntu-latest
@@ -112,8 +112,8 @@ jobs:
112112
publish-testpypi:
113113
name: Publish package to testpypi
114114
if:
115-
${{ (github.event_name == 'release' && github.event.action == 'published')
116-
|| (github.event_name == 'workflow_dispatch' && inputs.deploy) }}
115+
(github.event_name == 'release' && github.event.action == 'published') ||
116+
(github.event_name == 'workflow_dispatch' && inputs.deploy)
117117
needs:
118118
- dist
119119
- smoke-test
@@ -136,8 +136,8 @@ jobs:
136136
publish-pypi:
137137
name: Publish package to pypi
138138
if:
139-
${{ (github.event_name == 'release' && github.event.action == 'published')
140-
|| (github.event_name == 'workflow_dispatch' && inputs.deploy) }}
139+
(github.event_name == 'release' && github.event.action == 'published') ||
140+
(github.event_name == 'workflow_dispatch' && inputs.deploy)
141141
needs:
142142
- dist
143143
- smoke-test

.github/workflows/ci.yml

Lines changed: 82 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,29 @@ env:
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

1718
permissions: {}
1819

1920
jobs:
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) }}

.github/workflows/copier-update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
update:
1616
name: Update template
1717
runs-on: ubuntu-latest
18+
environment:
19+
name: pull-request
1820
strategy:
1921
fail-fast: true
2022
matrix:

0 commit comments

Comments
 (0)