@@ -22,123 +22,6 @@ concurrency:
22
22
# will skip running `yarn install` if it successfully fetched from cache
23
23
24
24
jobs :
25
- prettier :
26
- name : Format with Prettier
27
- runs-on : ubuntu-latest
28
- timeout-minutes : 5
29
- steps :
30
- - name : Checkout repo
31
- uses : actions/checkout@v3
32
-
33
- - name : Run prettier with actionsx/prettier
34
- uses : actionsx/prettier@v2
35
- with :
36
- args : --check --loglevel=warn .
37
-
38
- doctoc :
39
- name : Doctoc markdown files
40
- runs-on : ubuntu-latest
41
- timeout-minutes : 5
42
- steps :
43
- - name : Checkout repo
44
- uses : actions/checkout@v3
45
-
46
- - name : Get changed files
47
- id : changed-files
48
- uses :
tj-actions/[email protected]
49
- with :
50
- files : |
51
- docs/**
52
-
53
- - name : Install Node.js v16
54
- if : steps.changed-files.outputs.any_changed == 'true'
55
- uses : actions/setup-node@v3
56
- with :
57
- node-version : " 16"
58
- cache : " yarn"
59
-
60
- - name : Install doctoc
61
- run :
yarn global add [email protected]
62
-
63
- - name : Run doctoc
64
- if : steps.changed-files.outputs.any_changed == 'true'
65
- run : yarn doctoc
66
-
67
- lint-helm :
68
- name : Lint Helm chart
69
- runs-on : ubuntu-latest
70
- timeout-minutes : 5
71
- steps :
72
- - name : Checkout repo
73
- uses : actions/checkout@v3
74
- with :
75
- fetch-depth : 2
76
-
77
- - name : Get changed files
78
- id : changed-files
79
- uses :
tj-actions/[email protected]
80
- with :
81
- files : |
82
- ci/helm-chart/**
83
-
84
- - name : Install helm
85
- if : steps.changed-files.outputs.any_changed == 'true'
86
-
87
- with :
88
- token : ${{ secrets.GITHUB_TOKEN }}
89
-
90
- - name : Install helm kubeval plugin
91
- if : steps.changed-files.outputs.any_changed == 'true'
92
- run : helm plugin install https://github.com/instrumenta/helm-kubeval
93
-
94
- - name : Lint Helm chart
95
- if : steps.changed-files.outputs.any_changed == 'true'
96
- run : helm kubeval ci/helm-chart
97
-
98
- lint-ts :
99
- name : Lint TypeScript files
100
- runs-on : ubuntu-latest
101
- timeout-minutes : 5
102
- steps :
103
- - name : Checkout repo
104
- uses : actions/checkout@v3
105
- with :
106
- fetch-depth : 2
107
-
108
- - name : Get changed files
109
- id : changed-files
110
- uses :
tj-actions/[email protected]
111
- with :
112
- files : |
113
- **/*.ts
114
- **/*.js
115
- files_ignore : |
116
- lib/vscode/**
117
-
118
- - name : Install Node.js v16
119
- if : steps.changed-files.outputs.any_changed == 'true'
120
- uses : actions/setup-node@v3
121
- with :
122
- node-version : " 16"
123
-
124
- - name : Fetch dependencies from cache
125
- if : steps.changed-files.outputs.any_changed == 'true'
126
- id : cache-node-modules
127
- uses : actions/cache@v3
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
137
-
138
- - name : Lint TypeScript files
139
- if : steps.changed-files.outputs.any_changed == 'true'
140
- run : yarn lint:ts
141
-
142
25
build :
143
26
name : Build code-server
144
27
runs-on : ubuntu-latest
@@ -209,15 +92,6 @@ jobs:
209
92
# Our code imports code from VS Code's `out` directory meaning VS Code
210
93
# must be built before running these tests.
211
94
# TODO: Move to its own step?
212
- - name : Run code-server unit tests
213
- run : yarn test:unit
214
- if : success()
215
-
216
- - name : Upload coverage report to Codecov
217
- uses : codecov/codecov-action@v3
218
- with :
219
- token : ${{ secrets.CODECOV_TOKEN }}
220
- if : success()
221
95
222
96
# The release package does not contain any native modules
223
97
# and is neutral to architecture/os/libc version.
@@ -234,192 +108,3 @@ jobs:
234
108
with :
235
109
name : npm-package
236
110
path : ./package.tar.gz
237
-
238
- npm :
239
- name : Publish npm package
240
- # the npm-package gets uploaded as an artifact in Build
241
- # so we need that to complete before this runs
242
- needs : build
243
- # This environment "npm" requires someone from
244
- # coder/code-server-reviewers to approve the PR before this job runs.
245
- environment : npm
246
- # Only run if PR comes from base repo or event is not a PR
247
- # Reason: forks cannot access secrets and this will always fail
248
- if : github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
249
- runs-on : ubuntu-latest
250
- steps :
251
- - name : Checkout repo
252
- uses : actions/checkout@v3
253
-
254
- - name : Download artifact
255
- uses : actions/download-artifact@v3
256
- id : download
257
- with :
258
- name : " npm-package"
259
- path : release-npm-package
260
-
261
- - name : Run ./ci/steps/publish-npm.sh
262
- run : yarn publish:npm
263
- env :
264
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
265
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
266
- # NOTE@jsjoeio
267
- # NPM_ENVIRONMENT intentionally not set here.
268
- # Instead, itis determined in publish-npm.sh script
269
- # using GITHUB environment variables
270
-
271
- - name : Comment npm information
272
- uses : marocchino/sticky-pull-request-comment@v2
273
- with :
274
- GITHUB_TOKEN : ${{ github.token }}
275
- header : npm-dev-build
276
- message : |
277
- ✨ code-server dev build published to npm for PR #${{ github.event.number }}!
278
- * _Last publish status_: success
279
- * _Commit_: ${{ github.event.pull_request.head.sha }}
280
-
281
- To install in a local project, run:
282
- ```shell-session
283
- npm install @coder/code-server-pr@${{ github.event.number }}
284
- ```
285
-
286
- To install globally, run:
287
- ```shell-session
288
- npm install -g @coder/code-server-pr@${{ github.event.number }}
289
- ```
290
-
291
- test-e2e :
292
- name : Run e2e tests
293
- needs : build
294
- runs-on : ubuntu-latest
295
- timeout-minutes : 15
296
- steps :
297
- - name : Checkout repo
298
- uses : actions/checkout@v3
299
-
300
- - name : Install Node.js v16
301
- uses : actions/setup-node@v3
302
- with :
303
- node-version : " 16"
304
-
305
- - name : Fetch dependencies from cache
306
- id : cache-node-modules
307
- uses : actions/cache@v3
308
- with :
309
- path : " **/node_modules"
310
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
311
- restore-keys : |
312
- yarn-build-
313
-
314
- - name : Download npm package
315
- uses : actions/download-artifact@v3
316
- with :
317
- name : npm-package
318
-
319
- - name : Decompress npm package
320
- run : tar -xzf package.tar.gz
321
-
322
- - name : Install release package dependencies
323
- run : cd release && yarn install
324
-
325
- - name : Install dependencies
326
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
327
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
328
-
329
- - name : Install Playwright OS dependencies
330
- run : |
331
- ./test/node_modules/.bin/playwright install-deps
332
- ./test/node_modules/.bin/playwright install
333
-
334
- - name : Run end-to-end tests
335
- run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
336
-
337
- - name : Upload test artifacts
338
- if : always()
339
- uses : actions/upload-artifact@v3
340
- with :
341
- name : failed-test-videos
342
- path : ./test/test-results
343
-
344
- - name : Remove release packages and test artifacts
345
- run : rm -rf ./release ./test/test-results
346
-
347
- test-e2e-proxy :
348
- name : Run e2e tests behind proxy
349
- needs : build
350
- runs-on : ubuntu-latest
351
- timeout-minutes : 25
352
- steps :
353
- - name : Checkout repo
354
- uses : actions/checkout@v3
355
-
356
- - name : Install Node.js v16
357
- uses : actions/setup-node@v3
358
- with :
359
- node-version : " 16"
360
-
361
- - name : Fetch dependencies from cache
362
- id : cache-node-modules
363
- uses : actions/cache@v3
364
- with :
365
- path : " **/node_modules"
366
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
367
- restore-keys : |
368
- yarn-build-
369
-
370
- - name : Download npm package
371
- uses : actions/download-artifact@v3
372
- with :
373
- name : npm-package
374
-
375
- - name : Decompress npm package
376
- run : tar -xzf package.tar.gz
377
-
378
- - name : Install release package dependencies
379
- run : cd release && yarn install
380
-
381
- - name : Install dependencies
382
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
383
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
384
-
385
- - name : Install Playwright OS dependencies
386
- run : |
387
- ./test/node_modules/.bin/playwright install-deps
388
- ./test/node_modules/.bin/playwright install
389
-
390
- - name : Cache Caddy
391
- uses : actions/cache@v2
392
- id : caddy-cache
393
- with :
394
- path : |
395
- ~/.cache/caddy
396
- key : cache-caddy-2.5.2
397
-
398
- - name : Install Caddy
399
- env :
400
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
401
- if : steps.caddy-cache.outputs.cache-hit != 'true'
402
- run : |
403
- gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
404
- mkdir -p ~/.cache/caddy
405
- tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
406
-
407
- - name : Start Caddy
408
- run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
409
-
410
- - name : Run end-to-end tests
411
- run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
412
-
413
- - name : Stop Caddy
414
- if : always()
415
- run : sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
416
-
417
- - name : Upload test artifacts
418
- if : always()
419
- uses : actions/upload-artifact@v3
420
- with :
421
- name : failed-test-videos-proxy
422
- path : ./test/test-results
423
-
424
- - name : Remove release packages and test artifacts
425
- run : rm -rf ./release ./test/test-results
0 commit comments