@@ -19,7 +19,7 @@ concurrency:
19
19
# this ensures that it only executes if all previous jobs succeeded.
20
20
21
21
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
22
- # will skip running `yarn install` if it successfully fetched from cache
22
+ # will skip running `npm install` if it successfully fetched from cache
23
23
24
24
jobs :
25
25
prettier :
33
33
- name : Run prettier with actionsx/prettier
34
34
uses : actionsx/prettier@v3
35
35
with :
36
- args : --check --loglevel =warn .
36
+ args : --check --log-level =warn .
37
37
38
38
doctoc :
39
39
name : Doctoc markdown files
@@ -55,14 +55,16 @@ jobs:
55
55
uses : actions/setup-node@v4
56
56
with :
57
57
node-version-file : .node-version
58
- cache : " yarn"
58
+ cache : npm
59
+ cache-dependency-path : |
60
+ package-lock.json
61
+ test/package-lock.json
59
62
60
- - name : Install doctoc
61
- run :
yarn global add [email protected]
63
+ - if : steps.changed-files.outputs.any_changed == 'true'
64
+ run : SKIP_SUBMODULE_DEPS=1 npm ci
62
65
63
- - name : Run doctoc
64
- if : steps.changed-files.outputs.any_changed == 'true'
65
- run : yarn doctoc
66
+ - if : steps.changed-files.outputs.any_changed == 'true'
67
+ run : npm run doctoc
66
68
67
69
lint-helm :
68
70
name : Lint Helm chart
@@ -87,12 +89,10 @@ jobs:
87
89
with :
88
90
token : ${{ secrets.GITHUB_TOKEN }}
89
91
90
- - name : Install helm kubeval plugin
91
- if : steps.changed-files.outputs.any_changed == 'true'
92
+ - if : steps.changed-files.outputs.any_changed == 'true'
92
93
run : helm plugin install https://github.com/instrumenta/helm-kubeval
93
94
94
- - name : Lint Helm chart
95
- if : steps.changed-files.outputs.any_changed == 'true'
95
+ - if : steps.changed-files.outputs.any_changed == 'true'
96
96
run : helm kubeval ci/helm-chart
97
97
98
98
lint-ts :
@@ -120,24 +120,17 @@ jobs:
120
120
uses : actions/setup-node@v4
121
121
with :
122
122
node-version-file : .node-version
123
+ cache : npm
124
+ cache-dependency-path : |
125
+ package-lock.json
126
+ test/package-lock.json
123
127
124
- - name : Fetch dependencies from cache
125
- if : steps.changed-files.outputs.any_changed == 'true'
126
- id : cache-node-modules
127
- uses : actions/cache@v4
128
- with :
129
- path : " **/node_modules"
130
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
131
- restore-keys : |
132
- yarn-build-
133
-
134
- - name : Install dependencies
135
- if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
136
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
128
+ - if : steps.changed-files.outputs.any_changed == 'true'
129
+ run : SKIP_SUBMODULE_DEPS=1 npm ci
137
130
138
131
- name : Lint TypeScript files
139
132
if : steps.changed-files.outputs.any_changed == 'true'
140
- run : yarn lint:ts
133
+ run : npm run lint:ts
141
134
142
135
lint-actions :
143
136
name : Lint GitHub Actions
@@ -175,24 +168,16 @@ jobs:
175
168
uses : actions/setup-node@v4
176
169
with :
177
170
node-version-file : .node-version
171
+ cache : npm
172
+ cache-dependency-path : |
173
+ package-lock.json
174
+ test/package-lock.json
178
175
179
- - name : Fetch dependencies from cache
180
- if : steps.changed-files.outputs.any_changed == 'true'
181
- id : cache-node-modules
182
- uses : actions/cache@v4
183
- with :
184
- path : " **/node_modules"
185
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
186
- restore-keys : |
187
- yarn-build-
176
+ - if : steps.changed-files.outputs.any_changed == 'true'
177
+ run : SKIP_SUBMODULE_DEPS=1 npm ci
188
178
189
- - name : Install dependencies
190
- if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
191
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
192
-
193
- - name : Run unit tests
194
- if : steps.changed-files.outputs.any_changed == 'true'
195
- run : yarn test:unit
179
+ - if : steps.changed-files.outputs.any_changed == 'true'
180
+ run : npm run test:unit
196
181
197
182
- name : Upload coverage report to Codecov
198
183
uses : codecov/codecov-action@v4
@@ -229,24 +214,16 @@ jobs:
229
214
uses : actions/setup-node@v4
230
215
with :
231
216
node-version-file : .node-version
217
+ cache : npm
218
+ cache-dependency-path : |
219
+ package-lock.json
220
+ test/package-lock.json
232
221
233
- - name : Fetch dependencies from cache
234
- id : cache-node-modules
235
- uses : actions/cache@v4
236
- with :
237
- path : " **/node_modules"
238
- key : yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
239
- restore-keys : |
240
- yarn-build-code-server-
241
-
242
- - name : Install dependencies
243
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
244
- run : yarn --frozen-lockfile
222
+ - run : SKIP_SUBMODULE_DEPS=1 npm ci
245
223
246
- - name : Build code-server
247
- env :
224
+ - env :
248
225
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
249
- run : yarn build
226
+ run : npm run build
250
227
251
228
# Get Code's git hash. When this changes it means the content is
252
229
# different and we need to rebuild.
@@ -269,17 +246,19 @@ jobs:
269
246
env :
270
247
VERSION : " 0.0.0"
271
248
if : steps.cache-vscode.outputs.cache-hit != 'true'
272
- run : yarn build:vscode
249
+ run : |
250
+ pushd lib/vscode
251
+ npm ci
252
+ popd
253
+ npm run build:vscode
273
254
274
255
# The release package does not contain any native modules
275
256
# and is neutral to architecture/os/libc version.
276
- - name : Create release package
277
- run : yarn release
257
+ - run : npm run release
278
258
if : success()
279
259
280
260
# https://github.com/actions/upload-artifact/issues/38
281
- - name : Compress release package
282
- run : tar -czf package.tar.gz release
261
+ - run : tar -czf package.tar.gz release
283
262
284
263
- name : Upload npm package artifact
285
264
uses : actions/upload-artifact@v4
@@ -303,38 +282,28 @@ jobs:
303
282
uses : actions/setup-node@v4
304
283
with :
305
284
node-version-file : .node-version
285
+ cache : npm
286
+ cache-dependency-path : |
287
+ package-lock.json
288
+ test/package-lock.json
306
289
307
- - name : Fetch dependencies from cache
308
- id : cache-node-modules
309
- uses : actions/cache@v4
310
- with :
311
- path : " **/node_modules"
312
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
313
- restore-keys : |
314
- yarn-build-
290
+ - run : SKIP_SUBMODULE_DEPS=1 npm ci
315
291
316
292
- name : Download npm package
317
293
uses : actions/download-artifact@v4
318
294
with :
319
295
name : npm-package
320
296
321
- - name : Decompress npm package
322
- run : tar -xzf package.tar.gz
297
+ - run : tar -xzf package.tar.gz
323
298
324
- - name : Install release package dependencies
325
- run : cd release && npm install --unsafe-perm --omit=dev
326
-
327
- - name : Install dependencies
328
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
329
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
299
+ - run : cd release && npm install --unsafe-perm --omit=dev
330
300
331
301
- name : Install Playwright OS dependencies
332
302
run : |
333
303
./test/node_modules/.bin/playwright install-deps
334
304
./test/node_modules/.bin/playwright install
335
305
336
- - name : Run end-to-end tests
337
- run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
306
+ - run : CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
338
307
339
308
- name : Upload test artifacts
340
309
if : always()
@@ -362,30 +331,21 @@ jobs:
362
331
uses : actions/setup-node@v4
363
332
with :
364
333
node-version-file : .node-version
334
+ cache : npm
335
+ cache-dependency-path : |
336
+ package-lock.json
337
+ test/package-lock.json
365
338
366
- - name : Fetch dependencies from cache
367
- id : cache-node-modules
368
- uses : actions/cache@v4
369
- with :
370
- path : " **/node_modules"
371
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
372
- restore-keys : |
373
- yarn-build-
339
+ - run : SKIP_SUBMODULE_DEPS=1 npm ci
374
340
375
341
- name : Download npm package
376
342
uses : actions/download-artifact@v4
377
343
with :
378
344
name : npm-package
379
345
380
- - name : Decompress npm package
381
- run : tar -xzf package.tar.gz
346
+ - run : tar -xzf package.tar.gz
382
347
383
- - name : Install release package dependencies
384
- run : cd release && npm install --unsafe-perm --omit=dev
385
-
386
- - name : Install dependencies
387
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
388
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
348
+ - run : cd release && npm install --unsafe-perm --omit=dev
389
349
390
350
- name : Install Playwright OS dependencies
391
351
run : |
@@ -409,22 +369,15 @@ jobs:
409
369
mkdir -p ~/.cache/caddy
410
370
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
411
371
412
- - name : Start Caddy
413
- run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
372
+ - run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
414
373
415
- - name : Run end-to-end tests
416
- run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
374
+ - run : CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
417
375
418
- - name : Stop Caddy
419
- if : always()
376
+ - if : always()
420
377
run : sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
421
378
422
- - name : Upload test artifacts
423
- if : always()
379
+ - if : always()
424
380
uses : actions/upload-artifact@v4
425
381
with :
426
382
name : failed-test-videos-proxy
427
383
path : ./test/test-results
428
-
429
- - name : Remove release packages and test artifacts
430
- run : rm -rf ./release ./test/test-results
0 commit comments