1
1
name : Python package
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ branches-ignore :
6
+ - ' dependabot/**'
7
+ tags-ignore :
8
+ - ' *.[0-9][ab][0-9]'
9
+ pull_request : {}
4
10
5
11
jobs :
6
12
PEP8 :
13
+ name : Check with Ruff
7
14
runs-on : ubuntu-latest
8
15
steps :
9
- - uses : actions/checkout@v4.1.1
16
+ - uses : actions/checkout@v4
10
17
- name : Set up Python
11
- uses : actions/setup-python@v4.7.1
18
+ uses : actions/setup-python@v4
12
19
with :
13
20
python-version : ' 3.x'
14
21
cache : ' pip'
15
- cache-dependency-path : |
16
- requirements.txt
17
- flake8_requirements.txt
18
22
- name : Install dependencies
19
23
run : |
20
24
python -m pip install --upgrade pip
21
- pip install --upgrade -r flake8_requirements.txt
22
- - name : Lint with flake8
25
+ pip install --upgrade ruff
26
+ - name : Lint with ruff
23
27
run : |
24
- flake8 sqlalchemy_jsonfield
28
+ ruff sqlalchemy_jsonfield --output-format github
25
29
26
30
PyLint :
27
31
runs-on : ubuntu-latest
28
32
steps :
29
- - uses : actions/checkout@v4.1.1
33
+ - uses : actions/checkout@v4
30
34
- name : Set up Python
31
- uses : actions/setup-python@v4.7.1
35
+ uses : actions/setup-python@v4
32
36
with :
33
- python-version : ' 3.7 '
37
+ python-version : ' 3.11 '
34
38
cache : ' pip'
35
39
- name : Install dependencies
36
40
run : |
37
41
python -m pip install --upgrade pip
38
42
pip install --upgrade -r CI_REQUIREMENTS.txt
39
- pip install --upgrade "pylint >= 2.6 .0"
40
- - name : Generate version file
43
+ pip install --upgrade "pylint >= 3.0 .0"
44
+ - name : Install develop
41
45
run : |
42
- python setup.py --version clean
46
+ pip install -e .
43
47
- name : Lint with PyLint
44
48
run : |
45
49
pylint sqlalchemy_jsonfield
46
50
47
51
MyPy :
48
52
runs-on : ubuntu-latest
49
53
steps :
50
- - uses : actions/checkout@v4.1.1
54
+ - uses : actions/checkout@v4
51
55
- name : Set up Python
52
- uses : actions/setup-python@v4.7.1
56
+ uses : actions/setup-python@v4
53
57
with :
54
58
python-version : ' 3.x'
55
59
cache : ' pip'
@@ -61,19 +65,19 @@ jobs:
61
65
python -m pip install --upgrade pip
62
66
pip install --upgrade -r CI_REQUIREMENTS.txt
63
67
pip install --upgrade -r mypy_requirements.txt
64
- - name : Generate version file
68
+ - name : Install develop
65
69
run : |
66
- python setup.py --version clean
70
+ pip install -e .
67
71
- name : Lint with MyPy
68
72
run : |
69
73
mypy --strict --install-types --non-interactive sqlalchemy_jsonfield
70
74
71
75
Black :
72
76
runs-on : ubuntu-latest
73
77
steps :
74
- - uses : actions/checkout@v4.1.1
78
+ - uses : actions/checkout@v4
75
79
- name : Set up Python
76
- uses : actions/setup-python@v4.7.1
80
+ uses : actions/setup-python@v4
77
81
with :
78
82
python-version : ' 3.x'
79
83
cache : ' pip'
@@ -85,22 +89,39 @@ jobs:
85
89
run : |
86
90
black --check sqlalchemy_jsonfield
87
91
92
+ Refurb :
93
+ runs-on : ubuntu-latest
94
+ steps :
95
+ - uses : actions/checkout@v4
96
+ - name : Set up Python
97
+ uses : actions/setup-python@v4
98
+ with :
99
+ python-version : ' 3.x'
100
+ cache : ' pip'
101
+ - name : Install dependencies
102
+ run : |
103
+ python -m pip install --upgrade pip
104
+ pip install --upgrade refurb
105
+ - name : Lint with refurb
106
+ run : |
107
+ refurb sqlalchemy_jsonfield
108
+
88
109
Test :
89
- needs : [PEP8, PyLint, MyPy, Black]
110
+ needs : [PEP8, PyLint, MyPy, Black, Refurb] # isort is broken
90
111
runs-on : ${{ matrix.os }}
91
112
strategy :
92
113
max-parallel : 6
93
114
matrix :
94
- os : [" ubuntu-latest", " windows-latest" ]
95
- python-version : ["3.7", "3.8", "3.9", "3.10", "3.11"]
115
+ os : [ubuntu-latest, windows-latest]
116
+ python-version : ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
96
117
include :
97
118
- os : " ubuntu-latest"
98
119
python-version : " pypy3.9"
99
120
100
121
steps :
101
- - uses : actions/checkout@v4.1.1
122
+ - uses : actions/checkout@v4
102
123
- name : Set up Python ${{ matrix.python-version }}
103
- uses : actions/setup-python@v4.7.1
124
+ uses : actions/setup-python@v4
104
125
with :
105
126
python-version : ${{ matrix.python-version }}
106
127
cache : ' pip'
@@ -112,37 +133,97 @@ jobs:
112
133
python -m pip install --upgrade pip wheel
113
134
pip install --upgrade -r CI_REQUIREMENTS.txt
114
135
pip install --upgrade -r pytest_requirements.txt
115
- - name : Build package and install develop
136
+ - name : Install develop
116
137
run : |
117
138
pip install -e .
118
139
- name : Test with pytest
119
140
run : py.test --cov-report= --cov=sqlalchemy_jsonfield test
120
141
- name : Report coverage
121
142
run : |
122
143
coverage report -m
144
+ coverage xml
123
145
# coverage report -m --fail-under 85
146
+ - name : Coveralls Parallel
147
+ uses : coverallsapp/github-action@v2
148
+ with :
149
+ flag-name : run-${{ matrix.python-version }}-${{ matrix.os }}
150
+ parallel : true
151
+ file : coverage.xml
124
152
125
- Deploy :
126
- needs : [Test]
127
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
153
+ UploadCoverage :
154
+ name : Upload coverage to Coveralls
155
+ needs : [ Test ]
156
+ if : ${{ always() }}
128
157
runs-on : ubuntu-latest
129
158
steps :
130
-
159
+ - name : Coveralls Finished
160
+ uses : coverallsapp/github-action@v2
161
+ with :
162
+ parallel-finished : true
163
+
164
+ Build :
165
+ needs : [ Test ]
166
+ runs-on : ubuntu-latest
167
+ steps :
168
+ - uses : actions/checkout@v4
169
+ with :
170
+ fetch-depth : 0 # need for setuptools_scm
131
171
- name : Set up Python
132
- uses : actions/setup-python@v4.7.1
172
+ uses : actions/setup-python@v4
133
173
with :
134
174
python-version : ' 3.x'
135
- cache : ' pip'
136
175
- name : Install dependencies
137
176
run : |
138
177
python -m pip install --upgrade pip
139
178
pip install --upgrade twine build
140
179
- name : Build package
141
180
run : |
142
181
python -m build
143
- - name : Deploy
144
- env :
145
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
146
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
182
+ - uses : actions/upload-artifact@v3
183
+ with :
184
+ path : dist/*
185
+ name : wheels
186
+
187
+ Metadata :
188
+ name : Validate metadata
189
+ runs-on : ubuntu-latest
190
+ needs : [ Build ]
191
+ steps :
192
+ - uses : actions/checkout@v4
193
+ - name : Set up Python
194
+ uses : actions/setup-python@v4
195
+ with :
196
+ python-version : ' 3.x'
197
+ cache : ' pip'
198
+ - name : Install dependencies
147
199
run : |
148
- twine upload --skip-existing dist/*
200
+ python -m pip install --upgrade pip
201
+ pip install --upgrade twine
202
+ - uses : actions/download-artifact@v3
203
+ with :
204
+ # unpacks default artifact into dist/
205
+ # if `name: wheels` is omitted, the action will create extra parent dir
206
+ name : wheels
207
+ path : dist
208
+ - name : Validate metadata
209
+ run : |
210
+ twine check dist/*
211
+
212
+ Deploy :
213
+ needs : [Build, Metadata]
214
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
215
+ runs-on : ubuntu-latest
216
+ environment :
217
+ name : pypi
218
+ url : https://pypi.org/p/SQLAlchemy-JSONField
219
+ permissions :
220
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
221
+ steps :
222
+ - uses : actions/download-artifact@v3
223
+ with :
224
+ # unpacks default artifact into dist/
225
+ # if `name: artifact` is omitted, the action will create extra parent dir
226
+ name : wheels
227
+ path : dist
228
+ - name : Publish package distributions to PyPI
229
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments