9
9
# Daily at 3:21
10
10
- cron : " 21 3 * * *"
11
11
12
+ env :
13
+ PIP_DISABLE_PIP_VERSION_CHECK : " 1"
14
+ PIP_NO_PYTHON_VERSION_WARNING : " 1"
15
+
12
16
jobs :
13
17
pre-commit :
14
18
runs-on : ubuntu-latest
15
19
steps :
16
20
- uses : actions/checkout@v3
17
21
- uses : actions/setup-python@v4
18
22
with :
19
- python-version : " 3.11 "
23
+ python-version : " 3.x "
20
24
-
uses :
pre-commit/[email protected]
21
25
26
+ list :
27
+ runs-on : ubuntu-latest
28
+ outputs :
29
+ noxenvs : ${{ steps.noxenvs-matrix.outputs.noxenvs }}
30
+ steps :
31
+ - uses : actions/checkout@v3
32
+ - name : Set up nox
33
+
34
+ - id : noxenvs-matrix
35
+ run : |
36
+ echo >>$GITHUB_OUTPUT noxenvs=$(
37
+ nox --list-sessions |
38
+ grep '^* ' |
39
+ cut -d ' ' -f 2- |
40
+ jq --raw-input --slurp 'split("\n") | map(select(. != ""))'
41
+ )
42
+
22
43
ci :
44
+ needs : list
23
45
runs-on : ${{ matrix.os }}
24
46
strategy :
25
47
fail-fast : false
26
48
matrix :
27
49
os : [macos-latest, ubuntu-latest, windows-latest]
28
- python-version :
29
- - name : pypy-3.9
30
- toxenv : pypy3-noextra-build
31
- - name : pypy-3.9
32
- toxenv : pypy3-noextra-tests
33
- - name : pypy-3.9
34
- toxenv : pypy3-format-build
35
- - name : pypy-3.9
36
- toxenv : pypy3-format-tests
37
- - name : pypy-3.9
38
- toxenv : pypy3-formatnongpl-build
39
- - name : pypy-3.9
40
- toxenv : pypy3-formatnongpl-tests
41
- - name : 3.8
42
- toxenv : py38-noextra-build
43
- - name : 3.8
44
- toxenv : py38-noextra-tests
45
- - name : 3.8
46
- toxenv : py38-format-build
47
- - name : 3.8
48
- toxenv : py38-format-tests
49
- - name : 3.8
50
- toxenv : py38-formatnongpl-build
51
- - name : 3.8
52
- toxenv : py38-formatnongpl-tests
53
- - name : 3.9
54
- toxenv : py39-noextra-build
55
- - name : 3.9
56
- toxenv : py39-noextra-tests
57
- - name : 3.9
58
- toxenv : py39-format-build
59
- - name : 3.9
60
- toxenv : py39-format-tests
61
- - name : 3.9
62
- toxenv : py39-formatnongpl-build
63
- - name : 3.9
64
- toxenv : py39-formatnongpl-tests
65
- - name : " 3.10"
66
- toxenv : py310-noextra-build
67
- - name : " 3.10"
68
- toxenv : py310-noextra-tests
69
- - name : " 3.10"
70
- toxenv : py310-format-build
71
- - name : " 3.10"
72
- toxenv : py310-format-tests
73
- - name : " 3.10"
74
- toxenv : py310-formatnongpl-build
75
- - name : " 3.10"
76
- toxenv : py310-formatnongpl-tests
77
- - name : " 3.11"
78
- toxenv : py311-noextra-build
79
- - name : " 3.11"
80
- toxenv : py311-noextra-tests
81
- - name : " 3.11"
82
- toxenv : py311-format-build
83
- - name : " 3.11"
84
- toxenv : py311-format-tests
85
- - name : " 3.11"
86
- toxenv : py311-formatnongpl-build
87
- - name : " 3.11"
88
- toxenv : py311-formatnongpl-tests
89
- - name : " 3.11"
90
- toxenv : docs-dirhtml
91
- - name : " 3.11"
92
- toxenv : docs-doctest
93
- - name : " 3.11"
94
- toxenv : docs-linkcheck
95
- - name : " 3.11"
96
- toxenv : docs-spelling
97
- - name : " 3.11"
98
- toxenv : docs-style
99
- - name : " 3.11"
100
- toxenv : readme
101
- - name : " 3.11"
102
- toxenv : secrets
103
- - name : " 3.11"
104
- toxenv : style
105
- - name : " 3.11"
106
- toxenv : typing
50
+ noxenv : ${{ fromJson(needs.list.outputs.noxenvs) }}
51
+ posargs : [""]
107
52
include :
108
53
- os : ubuntu-latest
109
- python-version :
110
- name : " 3.11"
111
- toxenv : py311-format-ghcoverage
112
- - os : ubuntu-latest
113
- python-version :
114
- name : " 3.11"
115
- toxenv : py311-noextra-ghcoverage
116
- - os : ubuntu-latest
117
- python-version :
118
- name : " 3.11"
119
- toxenv : format-audit
120
- - os : ubuntu-latest
121
- python-version :
122
- name : " 3.11"
123
- toxenv : formatnongpl-audit
54
+ noxenv : " tests-3.11(extras='[format]')"
55
+ posargs : ghcoverage
124
56
- os : ubuntu-latest
125
- python-version :
126
- name : " 3.11"
127
- toxenv : noextra-audit
57
+ noxenv : " tests-3.11(extras='')"
58
+ posargs : ghcoverage
128
59
exclude :
129
60
- os : windows-latest
130
- python-version :
131
- name : " 3.11"
132
- toxenv : readme
61
+ noxenv : readme
133
62
- os : windows-latest
134
- python-version :
135
- name : " 3.11"
136
- toxenv : docs-dirhtml
63
+ noxenv : " docs(dirhtml)"
137
64
- os : windows-latest
138
- python-version :
139
- name : " 3.11"
140
- toxenv : docs-doctest
65
+ noxenv : " docs(doctest)"
141
66
- os : windows-latest
142
- python-version :
143
- name : " 3.11"
144
- toxenv : docs-linkcheck
67
+ noxenv : " docs(linkcheck)"
145
68
- os : windows-latest
146
- python-version :
147
- name : " 3.11"
148
- toxenv : docs-spelling
69
+ noxenv : " docs(spelling)"
149
70
- os : windows-latest
150
- python-version :
151
- name : " 3.11"
152
- toxenv : docs-style
71
+ noxenv : " docs(style)"
153
72
154
73
steps :
155
74
- uses : actions/checkout@v3
156
- - name : Set up Python ${{ matrix.python-version.name }}
157
- uses : actions/setup-python@v4
158
- with :
159
- python-version : ${{ matrix.python-version.name }}
160
75
- name : Install dependencies
161
- run : >
162
- sudo apt-get update &&
163
- sudo apt-get install -y libenchant-2-dev libxml2-dev libxslt-dev
164
- if : runner.os == 'Linux' && startsWith(matrix.python-version.toxenv, 'docs-')
76
+ run : sudo apt-get update && sudo apt-get install -y libenchant-2-dev
77
+ if : runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
165
78
- name : Install dependencies
166
79
run : brew install enchant
167
- if : runner.os == 'macOS' && startsWith(matrix.python-version.toxenv, 'docs-')
168
- - name : Install tox
169
- run : python -m pip install tox
80
+ if : runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
81
+ - name : Set up Python
82
+ uses : actions/setup-python@v4
83
+ with :
84
+ python-version : " 3.x"
85
+ - name : Set up nox
86
+
170
87
- name : Enable UTF-8 on Windows
171
88
run : echo "PYTHONUTF8=1" >> $env:GITHUB_ENV
172
- if : runner.os == 'Windows' && startsWith(matrix.python-version.toxenv , 'py ')
173
- - name : Run tox
174
- run : python -m tox -e " ${{ matrix.python-version.toxenv }}"
89
+ if : runner.os == 'Windows' && startsWith(matrix.noxenv , 'tests ')
90
+ - name : Run nox
91
+ run : nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
175
92
176
93
packaging :
177
94
needs : ci
@@ -181,30 +98,23 @@ jobs:
181
98
- uses : actions/checkout@v3
182
99
with :
183
100
fetch-depth : 0
184
- - uses : actions/setup-python@v4
101
+ - name : Set up Python
102
+ uses : actions/setup-python@v4
185
103
with :
186
- python-version : " 3.10 "
104
+ python-version : " 3.x "
187
105
- name : Install dependencies
188
106
run : python -m pip install build
189
107
- name : Create packages
190
108
run : python -m build .
191
- - uses : actions/upload-artifact@v3
192
- with :
193
- name : dist
194
- path : dist
195
- - name : Publish package
109
+ - name : Publish to PyPI
196
110
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
197
111
uses : pypa/gh-action-pypi-publish@release/v1
198
112
with :
199
- user : __token__
200
113
password : ${{ secrets.pypi_password }}
201
- - name : Create Release Notes
114
+ - name : Create a Release
202
115
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
203
- uses : actions/github-script@v6
116
+ uses : softprops/action-gh-release@v1
204
117
with :
205
- github-token : ${{ secrets.GITHUB_TOKEN }}
206
- script : |
207
- await github.request(`POST /repos/${{ github.repository }}/releases`, {
208
- tag_name: "${{ github.ref }}",
209
- generate_release_notes: true
210
- });
118
+ files : |
119
+ dist/*
120
+ generate_release_notes : true
0 commit comments