@@ -510,6 +510,93 @@ jobs:
510
510
- name : Remove release packages and test artifacts
511
511
run : rm -rf ./release-packages ./test/test-results
512
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
+
513
600
trivy-scan-repo :
514
601
permissions :
515
602
contents : read # for actions/checkout to fetch code
0 commit comments