29
29
steps :
30
30
- name : Checkout repo
31
31
uses : actions/checkout@v3
32
+ with :
33
+ fetch-depth : 0
34
+ submodules : true
32
35
33
36
- name : Install Node.js v14
34
37
uses : actions/setup-node@v3
@@ -38,21 +41,17 @@ jobs:
38
41
- name : Install helm
39
42
40
43
41
- # NOTE@jsjoeio
42
- # disabling this until we can audit the build process
43
- # and the usefulness of this step
44
- # See: https://github.com/coder/code-server/issues/4287
45
- # - name: Fetch dependencies from cache
46
- # id: cache-yarn
47
- # uses: actions/cache@v2
48
- # with:
49
- # path: "**/node_modules"
50
- # key: yarn-build-${{ hashFiles('**/yarn.lock') }}
51
- # restore-keys: |
52
- # yarn-build-
44
+ - name : Fetch dependencies from cache
45
+ id : cache-yarn
46
+ uses : actions/cache@v2
47
+ with :
48
+ path : " **/node_modules"
49
+ key : yarn-build-${{ hashFiles('**/yarn.lock') }}
50
+ restore-keys : |
51
+ yarn-build-
53
52
54
53
- name : Install dependencies
55
- # if: steps.cache-yarn.outputs.cache-hit != 'true'
54
+ if : steps.cache-yarn.outputs.cache-hit != 'true'
56
55
run : yarn --frozen-lockfile
57
56
58
57
- name : Run yarn fmt
71
70
steps :
72
71
- name : Checkout repo
73
72
uses : actions/checkout@v3
73
+ with :
74
+ fetch-depth : 0
75
+ submodules : true
74
76
75
77
- name : Install Node.js v14
76
78
uses : actions/setup-node@v3
@@ -102,56 +104,49 @@ jobs:
102
104
env :
103
105
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
104
106
steps :
105
- - uses : actions/checkout@v3
107
+ - name : Checkout repo
108
+ uses : actions/checkout@v3
106
109
with :
107
110
fetch-depth : 0
111
+ submodules : true
108
112
109
113
- name : Install Node.js v14
110
114
uses : actions/setup-node@v3
111
115
with :
112
116
node-version : " 14"
113
117
114
- # TODO@Teffen investigate why this omits code-oss-dev/node_modules
115
- # - name: Fetch dependencies from cache
116
- # id: cache-yarn
117
- # uses: actions/cache@v2
118
- # with:
119
- # path: |
120
- # "**/node_modules"
121
- # "**/vendor/modules"
122
- # "**/vendor/modules/code-oss-dev/node_modules"
123
- # key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
124
- # restore-keys: |
125
- # yarn-build-
118
+ - name : Fetch dependencies from cache
119
+ id : cache-yarn
120
+ uses : actions/cache@v2
121
+ with :
122
+ path : " **/node_modules"
123
+ key : yarn-build-${{ hashFiles('**/yarn.lock') }}
124
+ restore-keys : |
125
+ yarn-build-
126
126
127
127
- name : Install dependencies
128
- # if: steps.cache-yarn.outputs.cache-hit != 'true'
128
+ if : steps.cache-yarn.outputs.cache-hit != 'true'
129
129
run : yarn --frozen-lockfile
130
130
131
131
- name : Build code-server
132
132
run : yarn build
133
133
134
- # Parse the hash of the latest commit inside vendor/modules/code-oss-dev
135
- # use this to avoid rebuilding it if nothing changed
136
- # How it works: the `git log` command fetches the hash of the last commit
137
- # that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there,
138
- # the hash returned will change, and we rebuild vscode. If the hash did not change,
139
- # (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
140
- # This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
141
- - name : Get latest vendor/modules/code-oss-dev rev
134
+ # Get Code's git hash. When this changes it means the content is
135
+ # different and we need to rebuild. Use VSCODE_CACHE_VERSION to force a
136
+ # rebuild.
137
+ - name : Get latest lib/vscode rev
142
138
id : vscode-rev
143
- run : echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|' )"
139
+ run : echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode )"
144
140
145
- - name : Attempt to fetch vscode build from cache
141
+ - name : Fetch Code build from cache
146
142
id : cache-vscode-2
147
143
uses : actions/cache@v2
148
144
with :
149
145
path : |
150
- vendor/modules/code-oss-dev/.build
151
- vendor/modules/code-oss-dev/package.json
152
- vendor/modules/code-oss-dev/out-build
153
- vendor/modules/code-oss-dev/out-vscode-reh-web
154
- vendor/modules/code-oss-dev/out-vscode-reh-web-min
146
+ lib/vscode/.build
147
+ lib/vscode/out-build
148
+ lib/vscode/out-vscode-reh-web
149
+ lib/vscode/out-vscode-reh-web-min
155
150
key : vscode-reh-build-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}
156
151
157
152
- name : Build vscode
@@ -197,7 +192,10 @@ jobs:
197
192
if : github.event.pull_request.head.repo.full_name == github.repository
198
193
runs-on : ubuntu-latest
199
194
steps :
200
- - uses : actions/checkout@v3
195
+ - name : Checkout repo
196
+ uses : actions/checkout@v3
197
+ with :
198
+ fetch-depth : 0
201
199
202
200
- uses : actions/download-artifact@v3
203
201
id : download
@@ -235,7 +233,10 @@ jobs:
235
233
container : " centos:7"
236
234
237
235
steps :
238
- - uses : actions/checkout@v3
236
+ - name : Checkout repo
237
+ uses : actions/checkout@v3
238
+ with :
239
+ fetch-depth : 0
239
240
240
241
- name : Install Node.js v14
241
242
uses : actions/setup-node@v3
@@ -324,7 +325,10 @@ jobs:
324
325
NODE_VERSION : v14.17.4
325
326
326
327
steps :
327
- - uses : actions/checkout@v3
328
+ - name : Checkout repo
329
+ uses : actions/checkout@v3
330
+ with :
331
+ fetch-depth : 0
328
332
329
333
- name : Install Node.js v14
330
334
uses : actions/setup-node@v3
@@ -373,7 +377,10 @@ jobs:
373
377
runs-on : macos-latest
374
378
timeout-minutes : 15
375
379
steps :
376
- - uses : actions/checkout@v3
380
+ - name : Checkout repo
381
+ uses : actions/checkout@v3
382
+ with :
383
+ fetch-depth : 0
377
384
378
385
- name : Install Node.js v14
379
386
uses : actions/setup-node@v3
@@ -418,7 +425,11 @@ jobs:
418
425
# since VS Code will load faster due to the bundling.
419
426
CODE_SERVER_TEST_ENTRY : " ./release-packages/code-server-linux-amd64"
420
427
steps :
421
- - uses : actions/checkout@v3
428
+ - name : Checkout repo
429
+ uses : actions/checkout@v3
430
+ with :
431
+ fetch-depth : 0
432
+ submodules : true
422
433
423
434
- name : Install Node.js v14
424
435
uses : actions/setup-node@v3
@@ -455,12 +466,6 @@ jobs:
455
466
./test/node_modules/.bin/playwright install-deps
456
467
./test/node_modules/.bin/playwright install
457
468
458
- # TODO@jsjoeio - remove once we switch to submodules.
459
- - name : Create package.json for testing
460
- run : |
461
- mkdir -p ./vendor/modules/code-oss-dev
462
- echo '{ "version": "test" }' > ./vendor/modules/code-oss-dev/package.json
463
-
464
469
- name : Run end-to-end tests
465
470
run : yarn test:e2e
466
471
@@ -477,8 +482,11 @@ jobs:
477
482
trivy-scan-repo :
478
483
runs-on : ubuntu-20.04
479
484
steps :
480
- - name : Checkout code
485
+ - name : Checkout repo
481
486
uses : actions/checkout@v3
487
+ with :
488
+ fetch-depth : 0
489
+
482
490
- name : Run Trivy vulnerability scanner in repo mode
483
491
uses : aquasecurity/trivy-action@296212627a1e693efa09c00adc3e03b2ba8edf18
484
492
with :
@@ -489,6 +497,7 @@ jobs:
489
497
template : " @/contrib/sarif.tpl"
490
498
output : " trivy-repo-results.sarif"
491
499
severity : " HIGH,CRITICAL"
500
+
492
501
- name : Upload Trivy scan results to GitHub Security tab
493
502
uses : github/codeql-action/upload-sarif@v1
494
503
with :
0 commit comments