-
Notifications
You must be signed in to change notification settings - Fork 2
213 lines (175 loc) · 4.85 KB
/
code-quality.yaml
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: code quality
on:
pull_request:
branches:
- main
jobs:
server:
name: server
runs-on: ${{ matrix.runs-on }}
defaults:
run:
working-directory: ./grizzly-ls
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: ['ubuntu-latest']
include:
- python-version: '3.11'
runs-on: windows-latest
- python-version: '3.11'
runs-on: macos-12
steps:
- name: checkout
id: checkout
uses: actions/checkout@v3
- name: setup python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
id: pip
working-directory: ./
run: |
bash ./script/install.sh server
- name: pytest (unit+e2e)
id: pytest
run: python -m pytest
- name: coverage
id: coverage
run: python -m coverage report
client-vscode:
name: 'client/vscode (${{ matrix.runs-on }})'
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: ['ubuntu-latest', 'windows-latest', 'macos-12']
steps:
- name: checkout
id: checkout
uses: actions/checkout@v3
- name: setup python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: 'client/vscode/package-lock.json'
- name: install dependencies
id: install
run: |
bash ./script/install.sh client/vscode
bash ./script/install.sh server +e
npm install -g @vscode/vsce
- name: test
id: test
uses: hankolsen/xvfb-action@dcb076c1c3802845f73bb6fe14a009d8d3377255
env:
VERBOSE: true
VIRTUAL_ENV: ${{env.pythonLocation}}
with:
run: |
npm test
working-directory: './client/vscode'
- name: server logs
id: server-logs
if: always()
continue-on-error: true
run: |
cat tests/project/grizzly-ls.log
- name: test package
id: test-package
working-directory: './client/vscode'
run: |
vsce package
linting:
name: linting
runs-on: ubuntu-latest
steps:
- name: checkout
id: checkout
uses: actions/checkout@v3
- name: setup python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: './client/vscode/package-lock.json'
- name: install dependencies
id: install
run: |
bash ./script/install.sh
- name: 'server: pylint'
id: server-pylint
if: always()
working-directory: ./grizzly-ls
run: python3 -m pylint --jobs=0 --fail-under=10 src/ tests/
- name: 'server: mypy'
id: server-mypy
if: always()
working-directory: ./grizzly-ls
run: python3 -m mypy --config-file=pyproject.toml src/ tests/
- name: 'server: flake8'
id: server-flake8
if: always()
working-directory: ./grizzly-ls
run: python3 -m flake8
- name: 'server: black'
id: server-black
if: always()
working-directory: ./grizzly-ls
run: python3 -m black --check .
- name: 'client: eslint'
id: client-eslint
if: always()
working-directory: ./client/vscode
run: npm run lint
documentation-scripts:
name: 'documentation / ${{ matrix.script }}'
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
script:
- script/docs-generate-licenses.py
steps:
- name: checkout
id: checkout
uses: actions/checkout@v3
- name: setup python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: install python dependencies
id: pip
working-directory: ./grizzly-ls
run: python -m pip install --upgrade .[dev]
- name: exists
run: test -e ${{ matrix.script }}
- name: executable
run: test -x ${{ matrix.script }}
- name: runnable
run: ./${{ matrix.script }} 1> /dev/null
releaseable:
name: releasable
runs-on: 'ubuntu-latest'
if: always()
needs:
- server
- client-vscode
- linting
- documentation-scripts
steps:
- uses: technote-space/workflow-conclusion-action@v3
- name: is releaseable?
run: |
[[ "${{ env.WORKFLOW_CONCLUSION }}" == "success" ]] || exit 1