@@ -19,7 +19,7 @@ concurrency:
1919# this ensures that it only executes if all previous jobs succeeded.
2020
2121# 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
2323
2424jobs :
2525 prettier :
@@ -55,14 +55,16 @@ jobs:
5555 uses : actions/setup-node@v4
5656 with :
5757 node-version-file : .node-version
58- cache : " yarn"
58+ cache : npm
59+ cache-dependency-path : |
60+ package-lock.json
61+ test/package-lock.json
5962
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
6265
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
6668
6769 lint-helm :
6870 name : Lint Helm chart
@@ -87,12 +89,10 @@ jobs:
8789 with :
8890 token : ${{ secrets.GITHUB_TOKEN }}
8991
90- - name : Install helm kubeval plugin
91- if : steps.changed-files.outputs.any_changed == 'true'
92+ - if : steps.changed-files.outputs.any_changed == 'true'
9293 run : helm plugin install https://github.com/instrumenta/helm-kubeval
9394
94- - name : Lint Helm chart
95- if : steps.changed-files.outputs.any_changed == 'true'
95+ - if : steps.changed-files.outputs.any_changed == 'true'
9696 run : helm kubeval ci/helm-chart
9797
9898 lint-ts :
@@ -120,24 +120,17 @@ jobs:
120120 uses : actions/setup-node@v4
121121 with :
122122 node-version-file : .node-version
123+ cache : npm
124+ cache-dependency-path : |
125+ package-lock.json
126+ test/package-lock.json
123127
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
137130
138131 - name : Lint TypeScript files
139132 if : steps.changed-files.outputs.any_changed == 'true'
140- run : yarn lint:ts
133+ run : npm run lint:ts
141134
142135 lint-actions :
143136 name : Lint GitHub Actions
@@ -175,24 +168,16 @@ jobs:
175168 uses : actions/setup-node@v4
176169 with :
177170 node-version-file : .node-version
171+ cache : npm
172+ cache-dependency-path : |
173+ package-lock.json
174+ test/package-lock.json
178175
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
188178
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
196181
197182 - name : Upload coverage report to Codecov
198183 uses : codecov/codecov-action@v4
@@ -229,24 +214,16 @@ jobs:
229214 uses : actions/setup-node@v4
230215 with :
231216 node-version-file : .node-version
217+ cache : npm
218+ cache-dependency-path : |
219+ package-lock.json
220+ test/package-lock.json
232221
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
245223
246- - name : Build code-server
247- env :
224+ - env :
248225 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
249- run : yarn build
226+ run : npm run build
250227
251228 # Get Code's git hash. When this changes it means the content is
252229 # different and we need to rebuild.
@@ -269,17 +246,19 @@ jobs:
269246 env :
270247 VERSION : " 0.0.0"
271248 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
273254
274255 # The release package does not contain any native modules
275256 # and is neutral to architecture/os/libc version.
276- - name : Create release package
277- run : yarn release
257+ - run : npm run release
278258 if : success()
279259
280260 # 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
283262
284263 - name : Upload npm package artifact
285264 uses : actions/upload-artifact@v4
@@ -303,38 +282,28 @@ jobs:
303282 uses : actions/setup-node@v4
304283 with :
305284 node-version-file : .node-version
285+ cache : npm
286+ cache-dependency-path : |
287+ package-lock.json
288+ test/package-lock.json
306289
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
315291
316292 - name : Download npm package
317293 uses : actions/download-artifact@v4
318294 with :
319295 name : npm-package
320296
321- - name : Decompress npm package
322- run : tar -xzf package.tar.gz
297+ - run : tar -xzf package.tar.gz
323298
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
330300
331301 - name : Install Playwright OS dependencies
332302 run : |
333303 ./test/node_modules/.bin/playwright install-deps
334304 ./test/node_modules/.bin/playwright install
335305
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
338307
339308 - name : Upload test artifacts
340309 if : always()
@@ -362,30 +331,21 @@ jobs:
362331 uses : actions/setup-node@v4
363332 with :
364333 node-version-file : .node-version
334+ cache : npm
335+ cache-dependency-path : |
336+ package-lock.json
337+ test/package-lock.json
365338
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
374340
375341 - name : Download npm package
376342 uses : actions/download-artifact@v4
377343 with :
378344 name : npm-package
379345
380- - name : Decompress npm package
381- run : tar -xzf package.tar.gz
346+ - run : tar -xzf package.tar.gz
382347
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
389349
390350 - name : Install Playwright OS dependencies
391351 run : |
@@ -409,22 +369,15 @@ jobs:
409369 mkdir -p ~/.cache/caddy
410370 tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
411371
412- - name : Start Caddy
413- run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
372+ - run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
414373
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 --global-timeout 840000
417375
418- - name : Stop Caddy
419- if : always()
376+ - if : always()
420377 run : sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
421378
422- - name : Upload test artifacts
423- if : always()
379+ - if : always()
424380 uses : actions/upload-artifact@v4
425381 with :
426382 name : failed-test-videos-proxy
427383 path : ./test/test-results
428-
429- - name : Remove release packages and test artifacts
430- run : rm -rf ./release ./test/test-results
0 commit comments