forked from scientific-python/cookie
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (140 loc) · 4.52 KB
/
reusable-cookie.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Cookie
on:
workflow_call:
env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint all
run: pipx run nox -s 'lint'
checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, windows-latest, macos-latest]
include:
- python-version: pypy-3.10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup uv
uses: astral-sh/setup-uv@v3
- name: Install nox
run: uv tool install nox
- name: Test pybind11
if: matrix.python-version != 'pypy-3.9'
run: nox -s 'tests(pybind11, novcs)' -s 'tests(pybind11, vcs)'
- name: Test scikit-build
run: nox -s 'tests(skbuild, novcs)' -s 'tests(skbuild, vcs)'
- name: Test poetry
run: nox -s 'tests(poetry, novcs)' -s 'tests(poetry, vcs)'
- name: Test flit
run: nox -s 'tests(flit, novcs)' -s 'tests(flit, vcs)'
- name: Test pdm
run: nox -s 'tests(pdm, novcs)' -s 'tests(pdm, vcs)'
- name: Test maturin
run: nox -s 'tests(maturin, novcs)'
- name: Test hatch
run: nox -s 'tests(hatch, novcs)' -s 'tests(hatch, vcs)'
- name: Test setuptools PEP 621
run: nox -s 'tests(setuptools, novcs)' -s 'tests(setuptools, vcs)'
- name: Native poetry tooling
run: nox -s 'native(poetry, novcs)' -s 'native(poetry, vcs)'
- name: Native pdm tooling
run: nox -s 'native(pdm, novcs)' -s 'native(pdm, vcs)'
- name: Activate MSVC for Meson
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Test meson-python
run: nox -s 'tests(mesonpy, novcs)'
- name: Compare copier template generation
run: nox -s compare_copier
- name: Compare cruft template generation
run: nox -s compare_cruft
nox:
name: Check included Noxfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup uv
uses: astral-sh/setup-uv@v3
- name: Install nox
run: uv tool install nox
- name: Test pybind11
run: |
nox -s 'nox(pybind11, vcs)'
nox -s 'nox(pybind11, vcs)' -- docs
- name: Test scikit-build
run: |
nox -s 'nox(skbuild, vcs)'
nox -s 'nox(skbuild, vcs)' -- docs
- name: Test poetry
run: |
nox -s 'nox(poetry, novcs)'
nox -s 'nox(poetry, novcs)' -- docs
- name: Test flit
run: |
nox -s 'nox(flit, novcs)'
nox -s 'nox(flit, novcs)' -- docs
- name: Test pdm
run: |
nox -s 'nox(pdm, vcs)'
nox -s 'nox(pdm, vcs)' -- docs
- name: Test maturin
run: |
nox -s 'nox(maturin, novcs)'
nox -s 'nox(maturin, novcs)' -- docs
- name: Test hatch
run: |
nox -s 'nox(hatch, vcs)'
nox -s 'nox(hatch, vcs)' -- docs
- name: Test setuptools PEP 621
run: |
nox -s 'nox(setuptools, vcs)'
nox -s 'nox(setuptools, vcs)' -- docs
- name: Activate MSVC for Meson
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Test meson-python
run: |
nox -s 'nox(mesonpy, novcs)'
nox -s 'nox(mesonpy, novcs)' -- docs
dist:
name: Distribution build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist and wheel
run: pipx run nox -s dist
- name: Show results
run: ls -l dist
- uses: actions/upload-artifact@v4
with:
name: Packages
path: dist
pass:
if: always()
needs: [dist, nox, checks, pre-commit]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}