7
7
strategy :
8
8
fail-fast : false
9
9
matrix :
10
- python-version : ["3.7 ", "3.8", "3.9", "3.10 "]
11
- django -version : ["2.2", "3.2", "4.0 "]
12
- grappelli : ["0 "]
10
+ grappelli : ["0 ", "1 "]
11
+ python -version : ["3.11 "]
12
+ django-version : ["4.2 "]
13
13
exclude :
14
- - python-version : " 3.7"
15
- django-version : " 4.0"
16
- - python-version : " 3.10"
17
- django-version : " 2.2"
18
- # Exclude some version combos that don't need to be tested (since
19
- # the combination of python and django versions is unlikely to
20
- # be germane to django-nested-admin)
21
- - python-version : " 3.8"
22
- django-version : " 3.2"
23
- - python-version : " 3.9"
24
- django-version : " 4.0"
14
+ - python-version : " 3.11"
15
+ grappelli : " 1"
25
16
include :
26
- - grappelli : " 0"
27
- name-suffix : " "
28
- - grappelli : " 1"
29
- name-suffix : " + grappelli"
30
- python-version : " 3.7"
31
- django-version : " 2.2"
32
- - grappelli : " 1"
33
- name-suffix : " + grappelli"
34
- python-version : " 3.10"
35
- django-version : " 3.2"
17
+ - python-version : " 3.9"
18
+ django-version : " 4.2"
19
+ grappelli : " 1"
20
+ - python-version : " 3.9"
21
+ django-version : " 5.0"
22
+ grappelli : " 0"
23
+ - python-version : " 3.10"
24
+ django-version : " 5.0"
25
+ grappelli : " 1"
26
+ - python-version : " 3.12"
27
+ django-version : " 5.1"
28
+ grappelli : " 0"
36
29
37
30
runs-on : ubuntu-latest
38
- name : Django ${{ matrix.django-version }} (Python ${{ matrix.python-version }})${{ matrix.name-suffix }}
31
+ name : Django ${{ matrix.django-version }} (Python ${{ matrix.python-version }})${{ matrix.grappelli == '1' && ' + grappelli' || '' }}
39
32
40
33
env :
41
34
DJANGO : ${{ matrix.django-version }}
@@ -45,47 +38,49 @@ jobs:
45
38
NODE_ENV : test
46
39
47
40
steps :
48
- - uses : actions/checkout@v2
41
+ - uses : actions/checkout@v3
49
42
50
43
- name : Set up Python ${{ matrix.python-version }}
51
- uses : actions/setup-python@v2
44
+ uses : actions/setup-python@v4
52
45
with :
53
46
python-version : ${{ matrix.python-version }}
54
47
55
48
- name : Setup chromedriver
56
- uses : nanasess/setup-chromedriver@v1.0.5
49
+ # uses: nanasess/setup-chromedriver@v2.2.2
50
+ uses : nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa
57
51
58
52
- name : Install tox
59
53
run : |
60
54
python3 -m pip install tox tox-gh-actions
61
55
62
56
- name : Cache instrumented static files
63
57
id : cache-test-dist
64
- uses : actions/cache@v2
58
+ uses : actions/cache@v3
65
59
with :
66
60
path : nested_admin/tests/static
67
- key : test-dist-${{ hashFiles('package-lock.json', '.github/workflows/test.yml', 'webpack.config.js', 'package.json', '.*rc*', 'frontend/** ') }}
61
+ key : test-dist-${{ hashFiles('package-lock.json', '.github/workflows/test.yml', 'webpack.config.js', 'package.json', '.*rc*', 'nested_admin/static/nested_admin/src/**/*.*s ') }}
68
62
69
63
- name : Cache node_modules
70
64
id : cache-node_modules
71
- uses : actions/cache@v2
65
+ uses : actions/cache@v3
72
66
with :
73
67
path : node_modules
74
68
key : node_modules-${{ hashFiles('package-lock.json') }}
75
69
76
- - name : Setup nodejs 12
77
- if : steps.cache-test-dist.outputs.cache-hit != 'true' || steps.cache-node_modules.outputs.cache-hit != 'true'
78
- uses : actions/setup-node@v2
70
+ - name : Setup nodejs
71
+ if : steps.cache-test-dist.outputs.cache-hit != 'true'
72
+ uses : actions/setup-node@v3
79
73
with :
80
- node-version : ' 12'
74
+ node-version : ' 16'
75
+ cache : ' npm'
81
76
82
77
- name : npm ci
83
- if : steps.cache-test-dist.outputs.cache-hit != 'true' || steps.cache-node_modules.outputs.cache-hit != 'true'
78
+ if : steps.cache-test-dist.outputs.cache-hit != 'true' && steps.cache-node_modules.outputs.cache-hit != 'true'
84
79
run : |
85
80
npm ci || npm ci || npm ci
86
81
87
82
- name : Build instrumented static files
88
- if : steps.cache-test-dist.outputs.cache-hit != 'true' || steps.cache-node_modules.outputs.cache-hit != 'true'
83
+ if : steps.cache-test-dist.outputs.cache-hit != 'true'
89
84
run : |
90
85
npm run build
91
86
98
93
99
94
- name : Upload junit xml
100
95
if : always()
101
- uses : actions/upload-artifact@v2
96
+ uses : actions/upload-artifact@v3
102
97
with :
103
98
name : junit-reports
104
99
path : reports/*.xml
@@ -115,27 +110,96 @@ jobs:
115
110
env :
116
111
CODECOV_NAME : ${{ github.workflow }}
117
112
113
+ lint :
114
+ runs-on : ubuntu-latest
115
+ strategy :
116
+ fail-fast : false
117
+ matrix :
118
+ tool : ["flake8", "black", "eslint", "stylelint"]
119
+ include :
120
+ - tool : flake8
121
+ language : python
122
+ - tool : black
123
+ language : python
124
+ - tool : eslint
125
+ language : javascript
126
+ - tool : stylelint
127
+ language : javascript
128
+
129
+ steps :
130
+ - uses : actions/checkout@v3
131
+
132
+ - uses : actions/setup-python@v4
133
+ if : matrix.language == 'python'
134
+ with :
135
+ python-version : 3.9
136
+
137
+ - name : Cache node_modules
138
+ if : matrix.language == 'javascript'
139
+ id : cache-node_modules
140
+ uses : actions/cache@v3
141
+ with :
142
+ path : node_modules
143
+ key : node_modules-${{ hashFiles('package-lock.json') }}-lint
144
+ restore-keys : |
145
+ node_modules-${{ hashFiles('package-lock.json') }}
146
+
147
+ - name : Setup nodejs
148
+ if : matrix.language == 'javascript'
149
+ uses : actions/setup-node@v3
150
+ with :
151
+ node-version : ' 16'
152
+ cache : ' npm'
153
+
154
+ - name : npm ci
155
+ if : matrix.language == 'javascript' && steps.cache-node_modules.outputs.cache-hit != 'true'
156
+ run : |
157
+ npm ci || npm ci || npm ci
158
+
159
+ - name : Run black
160
+ if : matrix.tool == 'black'
161
+ uses : psf/black@stable
162
+ with :
163
+ src : " nested_admin docs setup.py"
164
+ version : " 22.8.0"
165
+
166
+ - name : Install flake8
167
+ if : matrix.tool == 'flake8'
168
+ run : pip install flake8
169
+
170
+ - name : Run flake8
171
+ if : matrix.tool == 'flake8'
172
+ uses : suo/flake8-github-action@releases/v1
173
+ with :
174
+ checkName : ' lint'
175
+ env :
176
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
177
+
178
+ - name : Run ${{ matrix.tool }}
179
+ if : matrix.language == 'javascript'
180
+ run : |
181
+ npm run lint:${{ matrix.tool }}
182
+
118
183
report :
119
184
if : always()
120
185
needs : build
121
186
runs-on : ubuntu-latest
122
187
name : " Report Test Results"
123
188
steps :
124
- - uses : actions/download-artifact@v2
189
+ - uses : actions/download-artifact@v3
125
190
with :
126
191
name : junit-reports
127
192
128
193
- name : Publish tests report
129
- uses : mikepenz/action-junit-report@5703ba1461f35871cde0208140d737d3e1eef38f
194
+ uses : mikepenz/action-junit-report@1a91e26932fb7ba410a31fab1f09266a96d29971
130
195
with :
131
196
report_paths : ./*.xml
132
- github_token : ${{ secrets.GITHUB_TOKEN }}
133
197
require_tests : true
134
198
fail_on_failure : true
135
199
check_name : Test Report
136
200
137
201
success :
138
- needs : report
202
+ needs : [lint, report]
139
203
runs-on : ubuntu-latest
140
204
name : Test Successful
141
205
steps :
0 commit comments