39
39
node-version : " 16"
40
40
41
41
- name : Install helm
42
- uses : azure/setup-helm@v2.1
42
+ uses : azure/setup-helm@v3.3
43
43
44
44
- name : Fetch dependencies from cache
45
45
id : cache-yarn
@@ -143,14 +143,20 @@ jobs:
143
143
id : vscode-rev
144
144
run : echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
145
145
146
- # We need to rebuild when we have a new version of Code or when any of
147
- # the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
146
+ - name : Get version
147
+ id : version
148
+ run : echo "::set-output name=version::$(jq -r .version package.json)"
149
+
150
+ # We need to rebuild when we have a new version of Code, when any of
151
+ # the patches changed, or when the code-server version changes (since
152
+ # it gets embedded into the code). Use VSCODE_CACHE_VERSION to
153
+ # force a rebuild.
148
154
- name : Fetch prebuilt Code package from cache
149
155
id : cache-vscode
150
156
uses : actions/cache@v3
151
157
with :
152
158
path : lib/vscode-reh-web-*
153
- key : vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
159
+ key : vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh ') }}
154
160
155
161
- name : Build vscode
156
162
if : steps.cache-vscode.outputs.cache-hit != 'true'
@@ -164,7 +170,9 @@ jobs:
164
170
if : success()
165
171
166
172
- name : Upload coverage report to Codecov
167
- run : yarn coverage
173
+ uses : codecov/codecov-action@v3
174
+ with :
175
+ token : ${{ secrets.CODECOV_TOKEN }}
168
176
if : success()
169
177
170
178
# The release package does not contain any native modules
@@ -190,9 +198,9 @@ jobs:
190
198
# This environment "npm" requires someone from
191
199
# coder/code-server-reviewers to approve the PR before this job runs.
192
200
environment : npm
193
- # Only run if PR comes from base repo
201
+ # Only run if PR comes from base repo or on merge request
194
202
# Reason: forks cannot access secrets and this will always fail
195
- if : github.event.pull_request.head.repo.full_name == github.repository
203
+ if : github.event.pull_request.head.repo.full_name == github.repository || github.event.pull_request.merged == true
196
204
runs-on : ubuntu-latest
197
205
steps :
198
206
- name : Checkout repo
@@ -288,8 +296,11 @@ jobs:
288
296
- name : Build standalone release
289
297
run : source scl_source enable devtoolset-9 && yarn release:standalone
290
298
291
- - name : Sanity test standalone release
292
- run : yarn test:standalone-release
299
+ - name : Install test dependencies
300
+ run : SKIP_SUBMODULE_DEPS=1 yarn install
301
+
302
+ - name : Run integration tests on standalone release
303
+ run : yarn test:integration
293
304
294
305
- name : Build packages with nfpm
295
306
run : yarn package
@@ -421,8 +432,11 @@ jobs:
421
432
- name : Build standalone release
422
433
run : yarn release:standalone
423
434
424
- - name : Sanity test standalone release
425
- run : yarn test:standalone-release
435
+ - name : Install test dependencies
436
+ run : SKIP_SUBMODULE_DEPS=1 yarn install
437
+
438
+ - name : Run integration tests on standalone release
439
+ run : yarn test:integration
426
440
427
441
- name : Build packages with nfpm
428
442
run : yarn package
@@ -447,7 +461,6 @@ jobs:
447
461
uses : actions/checkout@v3
448
462
with :
449
463
fetch-depth : 0
450
- submodules : true
451
464
452
465
- name : Install Node.js v16
453
466
uses : actions/setup-node@v3
@@ -477,15 +490,15 @@ jobs:
477
490
478
491
- name : Install dependencies
479
492
if : steps.cache-yarn.outputs.cache-hit != 'true'
480
- run : yarn --frozen-lockfile
493
+ run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
481
494
482
495
- name : Install Playwright OS dependencies
483
496
run : |
484
497
./test/node_modules/.bin/playwright install-deps
485
498
./test/node_modules/.bin/playwright install
486
499
487
500
- name : Run end-to-end tests
488
- run : yarn test:e2e
501
+ run : yarn test:e2e --global-timeout 840000
489
502
490
503
- name : Upload test artifacts
491
504
if : always()
@@ -497,6 +510,93 @@ jobs:
497
510
- name : Remove release packages and test artifacts
498
511
run : rm -rf ./release-packages ./test/test-results
499
512
513
+ test-e2e-proxy :
514
+ name : End-to-end tests behind proxy
515
+ needs : package-linux-amd64
516
+ runs-on : ubuntu-latest
517
+ timeout-minutes : 25
518
+ env :
519
+ # Since we build code-server we might as well run tests from the release
520
+ # since VS Code will load faster due to the bundling.
521
+ CODE_SERVER_TEST_ENTRY : " ./release-packages/code-server-linux-amd64"
522
+ steps :
523
+ - name : Checkout repo
524
+ uses : actions/checkout@v3
525
+ with :
526
+ fetch-depth : 0
527
+
528
+ - name : Install Node.js v16
529
+ uses : actions/setup-node@v3
530
+ with :
531
+ node-version : " 16"
532
+
533
+ - name : Fetch dependencies from cache
534
+ id : cache-yarn
535
+ uses : actions/cache@v3
536
+ with :
537
+ path : " **/node_modules"
538
+ key : yarn-build-${{ hashFiles('**/yarn.lock') }}
539
+ restore-keys : |
540
+ yarn-build-
541
+
542
+ - name : Download release packages
543
+ uses : actions/download-artifact@v3
544
+ with :
545
+ name : release-packages
546
+ path : ./release-packages
547
+
548
+ - name : Untar code-server release
549
+ run : |
550
+ cd release-packages
551
+ tar -xzf code-server*-linux-amd64.tar.gz
552
+ mv code-server*-linux-amd64 code-server-linux-amd64
553
+
554
+ - name : Install dependencies
555
+ if : steps.cache-yarn.outputs.cache-hit != 'true'
556
+ run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
557
+
558
+ - name : Install Playwright OS dependencies
559
+ run : |
560
+ ./test/node_modules/.bin/playwright install-deps
561
+ ./test/node_modules/.bin/playwright install
562
+
563
+ - name : Cache Caddy
564
+ uses : actions/cache@v2
565
+ id : caddy-cache
566
+ with :
567
+ path : |
568
+ ~/.cache/caddy
569
+ key : cache-caddy-2.5.2
570
+
571
+ - name : Install Caddy
572
+ env :
573
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
574
+ if : steps.caddy-cache.outputs.cache-hit != 'true'
575
+ run : |
576
+ gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
577
+ mkdir -p ~/.cache/caddy
578
+ tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
579
+
580
+ - name : Start Caddy
581
+ run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
582
+
583
+ - name : Run end-to-end tests
584
+ run : yarn test:e2e:proxy
585
+
586
+ - name : Stop Caddy
587
+ if : always()
588
+ run : sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
589
+
590
+ - name : Upload test artifacts
591
+ if : always()
592
+ uses : actions/upload-artifact@v3
593
+ with :
594
+ name : failed-test-videos-proxy
595
+ path : ./test/test-results
596
+
597
+ - name : Remove release packages and test artifacts
598
+ run : rm -rf ./release-packages ./test/test-results
599
+
500
600
trivy-scan-repo :
501
601
permissions :
502
602
contents : read # for actions/checkout to fetch code
@@ -509,7 +609,7 @@ jobs:
509
609
fetch-depth : 0
510
610
511
611
- name : Run Trivy vulnerability scanner in repo mode
512
- uses : aquasecurity/trivy-action@e27605859b9550f81ddd818eb816c8cb83cf9650
612
+ uses : aquasecurity/trivy-action@cb606dfdb0d2b3698ace62192088ef4f5360b24f
513
613
with :
514
614
scan-type : " fs"
515
615
scan-ref : " ."
0 commit comments