5
5
branches :
6
6
- master
7
7
- release/**
8
+ tags-ignore :
9
+ - v**
8
10
9
11
permissions :
10
12
contents : read
11
13
12
14
jobs :
13
- lint :
14
- name : Lint
15
+ run-tox :
16
+ name : Tox | Test, Style, Lint, Typing, Pytype, Security and Docs
15
17
runs-on : ${{ matrix.platform }}
16
18
strategy :
17
19
fail-fast : false
18
20
matrix :
19
21
platform :
20
22
- ubuntu-latest
21
- python-version : ["3.8", "3.9", "3.10", "3. 11", "3.12"]
23
+ python-version : ["3.11", "3.12"]
22
24
steps :
23
25
- name : Checkout source at ${{ matrix.platform }}
24
26
uses : actions/checkout@v4
@@ -28,113 +30,20 @@ jobs:
28
30
uses : actions/setup-python@v5
29
31
with :
30
32
python-version : ${{ matrix.python-version }}
31
- cache : ' pip'
32
- cache-dependency-path : ' requirements/*.txt'
33
33
- name : Install dependencies
34
34
run : |
35
- pip install --upgrade pip
36
- pip install -r requirements/base.txt
37
- pip install -r requirements/ci.txt
38
- - name : Lint with Flake8
39
- run : |
40
- flake8 src/ tests/
41
- - name : Lint with PyLint
42
- run : |
43
- pylint src/ tests/
44
-
45
- pytype :
46
- name : Typing
47
- runs-on : ${{ matrix.platform }}
48
- strategy :
49
- fail-fast : false
50
- matrix :
51
- platform :
52
- - ubuntu-latest
53
- python-version : ["3.11"]
54
- steps :
55
- - name : Checkout source at ${{ matrix.platform }}
56
- uses : actions/checkout@v4
57
- with :
58
- ref : ${{ github.ref_name }}
59
- - name : Setup Python ${{ matrix.python-version }}
60
- uses : actions/setup-python@v5
61
- with :
62
- python-version : ${{ matrix.python-version }}
63
- cache : ' pip'
64
- cache-dependency-path : ' requirements/*.txt'
65
- - name : Install dependencies
66
- run : |
67
- pip install --upgrade pip
68
- pip install -r requirements/base.txt
69
- pip install -r requirements/ci.txt
70
- - name : Static type check with Pytype
71
- run : |
72
- pytype
73
-
74
- typing :
75
- name : Typing
76
- runs-on : ${{ matrix.platform }}
77
- strategy :
78
- fail-fast : false
79
- matrix :
80
- platform :
81
- - ubuntu-latest
82
- python-version : ["3.12"]
83
- steps :
84
- - name : Checkout source at ${{ matrix.platform }}
85
- uses : actions/checkout@v4
86
- with :
87
- ref : ${{ github.ref_name }}
88
- - name : Setup Python ${{ matrix.python-version }}
89
- uses : actions/setup-python@v5
90
- with :
91
- python-version : ${{ matrix.python-version }}
92
- cache : ' pip'
93
- cache-dependency-path : ' requirements/*.txt'
94
- - name : Install dependencies
95
- run : |
96
- pip install --upgrade pip
97
- pip install -r requirements/base.txt
98
- pip install -r requirements/ci.txt
99
- - name : Static type check with MyPy
100
- run : |
101
- mypy --install-types --non-interactive src/
102
-
103
- security :
104
- name : Security
105
- runs-on : ${{ matrix.platform }}
106
- strategy :
107
- fail-fast : false
108
- matrix :
109
- platform :
110
- - ubuntu-latest
111
- python-version : ["3.12"]
112
- steps :
113
- - name : Checkout source at ${{ matrix.platform }}
114
- uses : actions/checkout@v4
115
- with :
116
- ref : ${{ github.ref_name }}
117
- - name : Setup Python ${{ matrix.python-version }}
118
- uses : actions/setup-python@v5
119
- with :
120
- python-version : ${{ matrix.python-version }}
121
- cache : ' pip'
122
- cache-dependency-path : ' requirements/*.txt'
123
- - name : Install dependencies
124
- run : |
125
- pip install --upgrade pip
126
- pip install -r requirements/base.txt
127
- pip install -r requirements/ci.txt
128
- - name : Check security issue in code with Bandit
35
+ python -m pip install --upgrade pip tox
36
+ - name : Run tox
37
+ if : ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
129
38
run : |
130
- bandit -r src/
131
- - name : Check dependencies for known security vulnerabilities with Safety
39
+ tox -e py,py-async,style,typing,security,docs
40
+ - name : Run tox (Pytype)
41
+ if : ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
132
42
run : |
133
- safety check
43
+ tox -e pytype
134
44
135
45
test :
136
46
name : Test
137
- needs : [lint, typing, security]
138
47
runs-on : ${{ matrix.platform }}
139
48
strategy :
140
49
fail-fast : false
159
68
run : |
160
69
pip install --upgrade pip
161
70
pip install -r requirements/base.txt
162
- pip install -r requirements/test .txt
71
+ pip install -r requirements/tests .txt
163
72
- name : Test and and run coverage with PyTest
164
73
run : |
165
74
py.test
170
79
name : test-n-coverage-report
171
80
path : |
172
81
.coverage
82
+ coverage.lcov
173
83
junit/
174
84
htmlcov/
175
85
@@ -184,34 +94,21 @@ jobs:
184
94
- ubuntu-latest
185
95
python-version : ["3.12"]
186
96
steps :
187
- - name : Checkout source at ${{ matrix.platform }}
188
- uses : actions/checkout@v4
189
- with :
190
- ref : ${{ github.ref_name }}
191
- - name : Setup Python ${{ matrix.python-version }}
192
- uses : actions/setup-python@v5
193
- with :
194
- python-version : ${{ matrix.python-version }}
195
- cache : ' pip'
196
- cache-dependency-path : ' requirements/*.txt'
197
- - name : Install dependencies
198
- run : |
199
- pip install --upgrade pip
200
- pip install -r requirements/test.txt
201
97
- name : Download a coverage artifact
202
98
uses : actions/download-artifact@v4
203
99
with :
204
100
name : test-n-coverage-report
205
101
- name : Send coverage stats to Coveralls
206
- env :
207
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
208
- COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
209
- run : |
210
- coveralls
102
+ uses : coverallsapp/github-action@v2
103
+ with :
104
+ github-token : ${{ secrets.GITHUB_TOKEN }}
105
+ format : lcov
106
+ file : coverage.lcov
107
+ allow-empty : true
211
108
212
109
build :
213
110
name : Build source
214
- needs : coverage
111
+ needs : [run-tox, coverage]
215
112
runs-on : ${{ matrix.platform }}
216
113
strategy :
217
114
fail-fast : false
@@ -232,19 +129,16 @@ jobs:
232
129
python-version : ${{ matrix.python-version }}
233
130
- name : Build source and wheel distributions
234
131
run : |
235
- python -m pip install --upgrade pip setuptools build
132
+ python -m pip install build
236
133
python -m build --outdir dist-${{ matrix.platform }}-${{ matrix.python-version }}
237
134
- name : Tar build and wheel distributions files
238
- if : ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
239
135
run : |
240
- mv dist-${{ matrix.platform }}-${{ matrix.python-version }} dist
241
- tar -cvf dist.tar dist
136
+ tar -cvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar dist-${{ matrix.platform }}-${{ matrix.python-version }}
242
137
- name : Upload build and wheel distributions files
243
- if : ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
244
138
uses : actions/upload-artifact@v4
245
139
with :
246
- name : pre-release-build
247
- path : dist.tar
140
+ name : pre-release-build-${{ matrix.platform }}-${{ matrix.python-version }}
141
+ path : dist-${{ matrix.platform }}-${{ matrix.python-version }} .tar
248
142
249
143
publish-testpypi :
250
144
name : Publish to TestPyPI
@@ -270,30 +164,17 @@ jobs:
270
164
- name : Download build and wheel distributions files
271
165
uses : actions/download-artifact@v4
272
166
with :
273
- name : pre-release-build
167
+ name : pre-release-build-${{ matrix.platform }}-${{ matrix.python-version }}
274
168
- name : Build source and wheel distributions to version ${{ github.ref_name }}
275
169
run : |
276
- python -m pip install --upgrade pip setuptools twine
277
- tar -xvf dist.tar
278
- twine check --strict dist/*
170
+ python -m pip install twine
171
+ tar -xvf dist-${{ matrix.platform }}-${{ matrix.python-version }} .tar
172
+ twine check --strict dist-${{ matrix.platform }}-${{ matrix.python-version }} /*
279
173
- name : Publish distribution to TestPyPI
280
174
281
175
with :
282
176
user : __token__
283
177
password : ${{ secrets.TEST_PYPI_API_TOKEN }}
284
- repository_url : https://test.pypi.org/legacy/
285
- skip_existing : true
286
- # - name: Create GitHub Pre Release
287
- # id: create_release
288
- # uses: softprops/action-gh-release@v1
289
- # with:
290
- # name: ${{ github.ref_name }}
291
- # draft: false
292
- # prerelease: true
293
- # generate_release_notes: true
294
- # files: |
295
- # COPYING
296
- # LICENSE
297
- # AUTHORS
298
- # README.md
299
- # dist/*
178
+ repository-url : https://test.pypi.org/legacy/
179
+ packages-dir : dist-${{ matrix.platform }}-${{ matrix.python-version }}/
180
+ skip-existing : true
0 commit comments