@@ -127,7 +127,7 @@ jobs:
127
127
run : yarn lint:ts
128
128
129
129
build :
130
- name : Build
130
+ name : Build code-server
131
131
runs-on : ubuntu-latest
132
132
timeout-minutes : 30
133
133
env :
@@ -223,6 +223,7 @@ jobs:
223
223
path : ./package.tar.gz
224
224
225
225
npm :
226
+ name : Publish npm package
226
227
# the npm-package gets uploaded as an artifact in Build
227
228
# so we need that to complete before this runs
228
229
needs : build
@@ -274,18 +275,11 @@ jobs:
274
275
npm install -g @coder/code-server-pr@${{ github.event.number }}
275
276
```
276
277
277
- # TODO: cache building yarn --production
278
- # possibly 2m30s of savings(?)
279
- # this requires refactoring our release scripts
280
- package-linux-amd64 :
281
- name : x86-64 Linux build
278
+ test-e2e :
279
+ name : Run e2e tests
282
280
needs : build
283
281
runs-on : ubuntu-latest
284
282
timeout-minutes : 15
285
- container : " centos:7"
286
- env :
287
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
288
-
289
283
steps :
290
284
- name : Checkout repo
291
285
uses : actions/checkout@v3
@@ -295,36 +289,6 @@ jobs:
295
289
with :
296
290
node-version : " 16"
297
291
298
- - name : Install development tools
299
- run : |
300
- yum install -y epel-release centos-release-scl make
301
- yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
302
-
303
- - name : Install nfpm and envsubst
304
- run : |
305
- mkdir -p ~/.local/bin
306
- curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
307
- curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
308
- chmod +x envsubst
309
- mv envsubst ~/.local/bin
310
- echo "$HOME/.local/bin" >> $GITHUB_PATH
311
-
312
- - name : Install yarn
313
- run : npm install -g yarn
314
-
315
- - name : Download npm package
316
- uses : actions/download-artifact@v3
317
- with :
318
- name : npm-package
319
-
320
- - name : Decompress npm package
321
- run : tar -xzf package.tar.gz
322
-
323
- # NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
324
- # file when running inside a docker container.
325
- - name : Build standalone release
326
- run : source scl_source enable devtoolset-9 && yarn release:standalone
327
-
328
292
- name : Fetch dependencies from cache
329
293
id : cache-node-modules
330
294
uses : actions/cache@v3
@@ -334,134 +298,6 @@ jobs:
334
298
restore-keys : |
335
299
yarn-build-
336
300
337
- - name : Install test dependencies
338
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
339
- run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
340
-
341
- - name : Run integration tests on standalone release
342
- run : yarn test:integration
343
-
344
- - name : Upload coverage report to Codecov
345
- uses : codecov/codecov-action@v3
346
- with :
347
- token : ${{ secrets.CODECOV_TOKEN }}
348
- if : success()
349
-
350
- - name : Build packages with nfpm
351
- run : yarn package
352
-
353
- - name : Upload release artifacts
354
- uses : actions/upload-artifact@v3
355
- with :
356
- name : release-packages
357
- path : ./release-packages
358
-
359
- # NOTE@oxy:
360
- # We use Ubuntu 16.04 here, so that our build is more compatible
361
- # with older libc versions. We used to (Q1'20) use CentOS 7 here,
362
- # but it has a full update EOL of Q4'20 and a 'critical security'
363
- # update EOL of 2024. We're dropping full support a few years before
364
- # the final EOL, but I don't believe CentOS 7 has a large arm64 userbase.
365
- # It is not feasible to cross-compile with CentOS.
366
-
367
- # Cross-compile notes: To compile native dependencies for arm64,
368
- # we install the aarch64/armv7l cross toolchain and then set it as the default
369
- # compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
370
- # qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
371
- # so we just build with "native"/x86_64 node, then download arm64/armv7l node
372
- # and then put it in our release. We can't smoke test the cross build this way,
373
- # but this means we don't need to maintain a self-hosted runner!
374
-
375
- # NOTE@jsjoeio:
376
- # We used to use 16.04 until GitHub deprecated it on September 20, 2021
377
- # See here: https://github.com/actions/virtual-environments/pull/3862/files
378
- package-linux-cross :
379
- name : Linux cross-compile builds
380
- needs : build
381
- runs-on : ubuntu-18.04
382
- timeout-minutes : 15
383
- strategy :
384
- matrix :
385
- include :
386
- - prefix : aarch64-linux-gnu
387
- arch : arm64
388
- - prefix : arm-linux-gnueabihf
389
- arch : armv7l
390
-
391
- env :
392
- AR : ${{ format('{0}-ar', matrix.prefix) }}
393
- CC : ${{ format('{0}-gcc', matrix.prefix) }}
394
- CXX : ${{ format('{0}-g++', matrix.prefix) }}
395
- LINK : ${{ format('{0}-g++', matrix.prefix) }}
396
- NPM_CONFIG_ARCH : ${{ matrix.arch }}
397
- NODE_VERSION : v16.13.0
398
-
399
- steps :
400
- - name : Checkout repo
401
- uses : actions/checkout@v3
402
-
403
- - name : Install Node.js v16
404
- uses : actions/setup-node@v3
405
- with :
406
- node-version : " 16"
407
-
408
- - name : Install nfpm
409
- run : |
410
- mkdir -p ~/.local/bin
411
- curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
412
- echo "$HOME/.local/bin" >> $GITHUB_PATH
413
-
414
- - name : Install cross-compiler
415
- run : sudo apt update && sudo apt install $PACKAGE
416
- env :
417
- PACKAGE : ${{ format('g++-{0}', matrix.prefix) }}
418
-
419
- - name : Download npm package
420
- uses : actions/download-artifact@v3
421
- with :
422
- name : npm-package
423
-
424
- - name : Decompress npm package
425
- run : tar -xzf package.tar.gz
426
-
427
- - name : Build standalone release
428
- run : yarn release:standalone
429
-
430
- - name : Replace node with cross-compile equivalent
431
- run : |
432
- wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz
433
- tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
434
- mv ./node ./release-standalone/lib/node
435
-
436
- - name : Build packages with nfpm
437
- run : yarn package ${NPM_CONFIG_ARCH}
438
-
439
- - name : Upload release artifacts
440
- uses : actions/upload-artifact@v3
441
- with :
442
- name : release-packages
443
- path : ./release-packages
444
-
445
- package-macos-amd64 :
446
- name : x86-64 macOS build
447
- needs : build
448
- runs-on : macos-latest
449
- timeout-minutes : 15
450
- steps :
451
- - name : Checkout repo
452
- uses : actions/checkout@v3
453
-
454
- - name : Install Node.js v16
455
- uses : actions/setup-node@v3
456
- with :
457
- node-version : " 16"
458
-
459
- - name : Install nfpm
460
- run : |
461
- mkdir -p ~/.local/bin
462
- curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
463
- echo "$HOME/.local/bin" >> $GITHUB_PATH
464
-
465
301
- name : Download npm package
466
302
uses : actions/download-artifact@v3
467
303
with :
@@ -470,72 +306,8 @@ jobs:
470
306
- name : Decompress npm package
471
307
run : tar -xzf package.tar.gz
472
308
473
- - name : Build standalone release
474
- run : yarn release:standalone
475
-
476
- - name : Fetch dependencies from cache
477
- id : cache-node-modules
478
- uses : actions/cache@v3
479
- with :
480
- path : " **/node_modules"
481
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
482
- restore-keys : |
483
- yarn-build-
484
-
485
- - name : Install test dependencies
486
- if : steps.cache-node-modules.outputs.cache-hit != 'true'
487
- run : SKIP_SUBMODULE_DEPS=1 yarn install
488
-
489
- - name : Run native module tests on standalone release
490
- run : yarn test:native
491
-
492
- - name : Build packages with nfpm
493
- run : yarn package
494
-
495
- - name : Upload release artifacts
496
- uses : actions/upload-artifact@v3
497
- with :
498
- name : release-packages
499
- path : ./release-packages
500
-
501
- test-e2e :
502
- name : End-to-end tests
503
- needs : package-linux-amd64
504
- runs-on : ubuntu-latest
505
- timeout-minutes : 15
506
- env :
507
- # Since we build code-server we might as well run tests from the release
508
- # since VS Code will load faster due to the bundling.
509
- CODE_SERVER_TEST_ENTRY : " ./release-packages/code-server-linux-amd64"
510
- steps :
511
- - name : Checkout repo
512
- uses : actions/checkout@v3
513
-
514
- - name : Install Node.js v16
515
- uses : actions/setup-node@v3
516
- with :
517
- node-version : " 16"
518
-
519
- - name : Fetch dependencies from cache
520
- id : cache-node-modules
521
- uses : actions/cache@v3
522
- with :
523
- path : " **/node_modules"
524
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
525
- restore-keys : |
526
- yarn-build-
527
-
528
- - name : Download release packages
529
- uses : actions/download-artifact@v3
530
- with :
531
- name : release-packages
532
- path : ./release-packages
533
-
534
- - name : Untar code-server release
535
- run : |
536
- cd release-packages
537
- tar -xzf code-server*-linux-amd64.tar.gz
538
- mv code-server*-linux-amd64 code-server-linux-amd64
309
+ - name : Install release package dependencies
310
+ run : cd release && yarn install
539
311
540
312
- name : Install dependencies
541
313
if : steps.cache-node-modules.outputs.cache-hit != 'true'
@@ -546,8 +318,14 @@ jobs:
546
318
./test/node_modules/.bin/playwright install-deps
547
319
./test/node_modules/.bin/playwright install
548
320
321
+ # TODO@jsjoeio - this is temp. We need to do an actual fix
322
+ - name : Copy node binary to release
323
+ run : |
324
+ ln -s $(which node) ./release/lib/node
325
+ ln -s $(which node) ./release/node
326
+
549
327
- name : Run end-to-end tests
550
- run : yarn test:e2e --global-timeout 840000
328
+ run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
551
329
552
330
- name : Upload test artifacts
553
331
if : always()
@@ -557,17 +335,13 @@ jobs:
557
335
path : ./test/test-results
558
336
559
337
- name : Remove release packages and test artifacts
560
- run : rm -rf ./release-packages ./test/test-results
338
+ run : rm -rf ./release ./test/test-results
561
339
562
340
test-e2e-proxy :
563
- name : End-to-end tests behind proxy
564
- needs : package-linux-amd64
341
+ name : Run e2e tests behind proxy
342
+ needs : build
565
343
runs-on : ubuntu-latest
566
344
timeout-minutes : 25
567
- env :
568
- # Since we build code-server we might as well run tests from the release
569
- # since VS Code will load faster due to the bundling.
570
- CODE_SERVER_TEST_ENTRY : " ./release-packages/code-server-linux-amd64"
571
345
steps :
572
346
- name : Checkout repo
573
347
uses : actions/checkout@v3
@@ -586,17 +360,16 @@ jobs:
586
360
restore-keys : |
587
361
yarn-build-
588
362
589
- - name : Download release packages
363
+ - name : Download npm package
590
364
uses : actions/download-artifact@v3
591
365
with :
592
- name : release-packages
593
- path : ./release-packages
366
+ name : npm-package
594
367
595
- - name : Untar code-server release
596
- run : |
597
- cd release-packages
598
- tar -xzf code-server*-linux-amd64.tar.gz
599
- mv code-server*-linux-amd64 code-server-linux-amd64
368
+ - name : Decompress npm package
369
+ run : tar -xzf package.tar.gz
370
+
371
+ - name : Install release package dependencies
372
+ run : cd release && yarn install
600
373
601
374
- name : Install dependencies
602
375
if : steps.cache-node-modules.outputs.cache-hit != 'true'
@@ -627,8 +400,14 @@ jobs:
627
400
- name : Start Caddy
628
401
run : sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
629
402
403
+ # TODO@jsjoeio - this is temp. We need to do an actual fix
404
+ - name : Copy node binary to release
405
+ run : |
406
+ ln -s $(which node) ./release/lib/node
407
+ ln -s $(which node) ./release/node
408
+
630
409
- name : Run end-to-end tests
631
- run : yarn test:e2e:proxy
410
+ run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
632
411
633
412
- name : Stop Caddy
634
413
if : always()
@@ -642,4 +421,4 @@ jobs:
642
421
path : ./test/test-results
643
422
644
423
- name : Remove release packages and test artifacts
645
- run : rm -rf ./release-packages ./test/test-results
424
+ run : rm -rf ./release ./test/test-results
0 commit comments