-
Notifications
You must be signed in to change notification settings - Fork 12
388 lines (386 loc) · 11.5 KB
/
checks.yml
File metadata and controls
388 lines (386 loc) · 11.5 KB
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
name: Check
on:
pull_request: ~
push:
branches:
- main
permissions: read-all
jobs:
check:
name: ${{ matrix.what }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
what:
- ci
- dependencies
- formatting
- js
- json
- licenses
- lockfile
- manifest
- md
- yml
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install tooling
uses: asdf-vm/actions/install@v4.0.1
if: ${{ matrix.what == 'ci' }}
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Check
run: npm run "check:${WHAT}"
env:
WHAT: ${{ matrix.what }}
codeql:
name: CodeQL (${{ matrix.what }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
what:
- javascript
- actions
permissions:
security-events: write # To upload CodeQL results
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Initialize CodeQL
uses: github/codeql-action/init@v4.35.1
with:
config-file: ./.github/codeql.yml
languages: ${{ matrix.what }}
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v4.35.1
reproducible:
name: Reproducible build
runs-on: ubuntu-24.04
needs:
- transpile
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Simulate publish
run: |
npm run transpile
npm pack
- name: Compute checksum
run: shasum -- *.tgz | tee checksums.txt
- name: Reset to a clean state
run: |
npm run clean
rm -- *.tgz
- name: Simulate publish again
run: |
npm run transpile
npm pack
- name: Verify checksum
run: shasum --check checksums.txt --strict
semgrep:
name: Semgrep
runs-on: ubuntu-24.04
permissions:
security-events: write # To upload SARIF results
container:
image: semgrep/semgrep
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Perform Semgrep analysis
run: semgrep --sarif --output semgrep.sarif
- name: Upload Semgrep report to GitHub
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
if: ${{ failure() || success() }}
with:
sarif_file: semgrep.sarif
test-breakage:
name: Breakage
runs-on: ubuntu-24.04
needs:
- test-integration
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Run breakage tests
run: npm run coverage:breakage
test-compatibility:
name: Runtime compatibility (${{ matrix.node-version }})
runs-on: ubuntu-24.04
needs:
- test-integration
strategy:
fail-fast: false
matrix:
node-version:
- 14.18.0
- 16.13.0
- 18.0.0
- 19.0.0
- 20.0.0
- 22.0.0
- 24.0.0
- 25.0.0
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version: ${{ matrix.node-version }}
- name: Install compatible npm version
run: npm install --global npm@8.1.2
- name: Install dependencies
run: npm clean-install
- name: Run runtime compatibility tests
run: npm run coverage:compat:runtime
- name: Run experimental regexp engine compatibility tests
if: ${{ matrix.node-version != '14.18.0' }}
run: npm run coverage:compat:regexp
test-dependencies:
name: Dependency compatibility (${{ matrix.name }}@${{ matrix.version }})
runs-on: ubuntu-24.04
needs:
- test-e2e
strategy:
fail-fast: false
matrix:
include:
- name: which
version: 4.0.0
- name: which
version: 5.0.0
- name: which
version: 6.0.0
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install required shells
run: sudo apt-get --assume-yes install csh zsh
- name: Install dependencies
run: npm clean-install
- name: Install ${{ matrix.name }}@${{ matrix.version }}
env:
NAME: ${{ matrix.name }}
VERSION: ${{ matrix.version }}
run: |
npm install "${NAME}@${VERSION}"
npm ls --all --omit dev
- name: Run end-to-end tests
run: npm run test:e2e
test-e2e:
name: End-to-end (${{ matrix.name }})
runs-on: ${{ matrix.os }}
needs:
- test-integration
strategy:
fail-fast: false
matrix:
include:
- name: MacOS
os: macos-26
- name: Ubuntu
os: ubuntu-24.04
- name: Windows
os: windows-2025
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install csh
if: ${{ matrix.name == 'Ubuntu' }}
run: sudo apt-get --assume-yes install csh
- name: Install Zsh
if: ${{ matrix.name == 'Ubuntu' }}
run: sudo apt-get --assume-yes install zsh
- name: Install dependencies
run: npm clean-install
- name: Run end-to-end tests
run: npm run coverage:e2e
test-integration:
name: Integration (${{ matrix.name }})
runs-on: ${{ matrix.os }}
needs:
- test-unit
- transpile
strategy:
fail-fast: false
matrix:
include:
- name: MacOS
os: macos-26
- name: Ubuntu
os: ubuntu-24.04
- name: Windows
os: windows-2025
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install csh
if: ${{ matrix.name == 'Ubuntu' }}
run: sudo apt-get --assume-yes install csh
- name: Install Zsh
if: ${{ matrix.name == 'Ubuntu' }}
run: sudo apt-get --assume-yes install zsh
- name: Install dependencies
run: npm clean-install
- name: Run integration tests
run: npm run coverage:integration
test-mutation-integration:
name: Mutation (integration)
runs-on: ubuntu-24.04
needs:
- test-integration
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Cache Stryker incremental report
uses: actions/cache@v5.0.3
with:
path: .cache/stryker-incremental-integration.json
key: mutation-integration-${{ github.run_number }}
restore-keys: |
mutation-integration-
- name: Install csh
run: sudo apt-get --assume-yes install csh
- name: Install Zsh
run: sudo apt-get --assume-yes install zsh
- name: Install dependencies
run: npm clean-install
- name: Run mutation tests
run: npm run mutation:integration
- name: Upload mutation report
uses: actions/upload-artifact@v7.0.0
if: ${{ failure() || success() }}
with:
name: mutation-integration-report
path: |
_reports/mutation/integration.html
.cache/stryker-incremental-integration.json
test-unit:
name: Unit
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Run unit tests
run: |
cd node_modules/shescape-previous
git init .
git add .
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git commit -m 'n/a'
git apply ../../2410.patch
- name: Run unit tests
run: npm run coverage:unit
transpile:
name: Transpile
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Verify action checksums
uses: ./.github/actions/ghasum
- name: Install Node.js
uses: actions/setup-node@v6.3.0
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Transpile to CommonJS
run: npm run transpile