-
Notifications
You must be signed in to change notification settings - Fork 204
275 lines (275 loc) · 10.2 KB
/
lint.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: lint
on: [push, pull_request]
jobs:
build:
name: Build for Lint Tasks
runs-on: ubuntu-latest
container: debian:stable
steps:
- name: Update package database
run: apt-get update -y
# See comments beginning at
# https://github.com/actions/runner/issues/763#issuecomment-1435474884
# Without Git, actions/checkout@v4 will resort to REST and will not
# create a .git folder or .git.config. The Problem Matcher looks for
# .git/config to find where the root of the repo is, so it must be
# present.
- name: Install Git
run: apt-get -y install git
- uses: actions/checkout@v4
- name: Install build tools
shell: bash
run: |
apt-get -y install pkg-config libtool autoconf \
automake g++ bison flex make bash-completion dh-autoreconf \
debhelper devscripts wget python3-full python3-pip
- name: Setup Python venv
shell: bash
run: |
python3 -m venv --system-site-packages ../venv
source ../venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Python lint tools
run: python3 -m pip install --no-input cpplint flake8
- name: Install build dependencies
shell: bash
run: |
apt-get -y install libcppunit-dev uuid-dev libncurses5-dev \
libmicrohttpd-dev protobuf-compiler python3-protobuf \
libprotobuf-dev libprotoc-dev zlib1g-dev libftdi-dev \
libusb-1.0-0-dev liblo-dev libavahi-client-dev python3-numpy
- name: Autoreconf
run: autoreconf -i
- name: Configure
run: ./configure --enable-rdm-tests --enable-ja-rule --enable-e133
- name: Build builtfiles
run: make builtfiles VERBOSE=1
- name: Display structure of the built files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Archive artifacts to speed up slow GH Actions upload/download
shell: bash
# If the file does not exist when tar excludes it, then it will not
# actually exclude it, so it must first be touched
run: |
touch ola-debian-stable-built-source-tree.tar.gz
tar --exclude=ola-debian-stable-built-source-tree.tar.gz -cvzf ola-debian-stable-built-source-tree.tar.gz .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- uses: actions/upload-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: ola-debian-stable-built-source-tree.tar.gz
check-licences:
name: Check Licences
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install Python
run: apt-get -y install python3 python-is-python3
- name: Enable Problem Matcher for GitHub annotations
run: echo "::add-matcher::.github/problem-matcher-lint-check-licences.json"
- name: Check licenses
shell: bash
run: ./scripts/enforce_licence.py
generic-nolints:
name: Count generic NOLINTs
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Enable Problem Matcher for GitHub annotations
run: echo "::add-matcher::.github/problem-matcher-lint-generic-nolints.json"
- name: Count the number of generic NOLINTs
shell: bash
run: ./scripts/count_generic_nolints.sh
cpplint:
name: cpplint
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install build tools
run: apt-get -y install make python3-full python3-pip
- name: Setup Python venv
shell: bash
run: |
python3 -m venv --system-site-packages ../venv
source ../venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Python lint tools
run: python3 -m pip install --no-input cpplint
- name: Enable Problem Matcher for GitHub annotations
run: echo "::add-matcher::.github/problem-matcher-lint-cpplint.json"
- name: cpplint
run: make cpplint VERBOSE=1
flake8:
name: flake8
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install build tools
run: apt-get -y install make python3-full python3-pip
- name: Setup Python venv
shell: bash
run: |
python3 -m venv --system-site-packages ../venv
source ../venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Python lint tools
run: python3 -m pip install --no-input flake8
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: flake8
run: make flake8 VERBOSE=1
spellintian:
name: spellintian
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install lint tools
run: apt-get -y install moreutils lintian
- name: Enable Problem Matcher for GitHub annotations
run: echo "::add-matcher::.github/problem-matcher-lint-spellintian.json"
- name: spellintian
run: ./scripts/spelling.sh spellintian
codespell:
name: codespell
runs-on: ubuntu-latest
container: debian:stable
needs: build
steps:
- name: Download built source tree archive
uses: actions/download-artifact@v4
with:
name: ola-debian-stable-built-source-tree
path: .
- name: SHA256 artifact archive
run: sha256sum ola-debian-stable-built-source-tree.tar.gz
- name: Unarchive artifacts and delete archive
shell: bash
run: |
tar -xvzf ola-debian-stable-built-source-tree.tar.gz .
rm ola-debian-stable-built-source-tree.tar.gz
- name: Display structure of extracted files
if: env.ACTIONS_STEP_DEBUG == 'true'
run: ls -alR
- name: Update package database
run: apt-get update -y
- name: Install lint tools
run: apt-get -y install python3-full python3-pip git moreutils
- name: Setup Python venv
shell: bash
run: |
python3 -m venv --system-site-packages ../venv
source ../venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install Python lint tools
run: python3 -m pip install --no-input git+https://github.com/codespell-project/codespell.git
- name: Setup codespell annotations
uses: codespell-project/codespell-problem-matcher@v1
- name: codespell
run: ./scripts/spelling.sh codespell
weblint:
name: weblint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js v18
uses: actions/setup-node@v4
with:
node-version: 18 # LTS
cache: 'npm'
cache-dependency-path: './javascript/new-src/package-lock.json'
- name: Install npm dependencies
run: npm ci
working-directory: ./javascript/new-src
- name: Run weblint
run: npm test
working-directory: ./javascript/new-src