19
19
name : Pre-build checks
20
20
runs-on : ubuntu-latest
21
21
timeout-minutes : 15
22
- env :
23
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
24
22
steps :
25
23
- name : Checkout repo
26
24
uses : actions/checkout@v2
@@ -33,17 +31,21 @@ jobs:
33
31
- name : Install helm
34
32
35
33
36
- - name : Fetch dependencies from cache
37
- id : cache-yarn
38
- uses : actions/cache@v2
39
- with :
40
- path : " **/node_modules"
41
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
42
- restore-keys : |
43
- yarn-build-
34
+ # NOTE@jsjoeio
35
+ # disabling this until we can audit the build process
36
+ # and the usefulness of this step
37
+ # See: https://github.com/cdr/code-server/issues/4287
38
+ # - name: Fetch dependencies from cache
39
+ # id: cache-yarn
40
+ # uses: actions/cache@v2
41
+ # with:
42
+ # path: "**/node_modules"
43
+ # key: yarn-build-${{ hashFiles('**/yarn.lock') }}
44
+ # restore-keys: |
45
+ # yarn-build-
44
46
45
47
- name : Install dependencies
46
- if : steps.cache-yarn.outputs.cache-hit != 'true'
48
+ # if: steps.cache-yarn.outputs.cache-hit != 'true'
47
49
run : yarn --frozen-lockfile
48
50
49
51
- name : Run yarn fmt
54
56
run : yarn lint
55
57
if : success()
56
58
57
- - name : Run code-server unit tests
58
- run : yarn test:unit
59
- if : success()
60
-
61
- - name : Upload coverage report to Codecov
62
- run : yarn coverage
63
- if : success()
64
-
65
59
audit-ci :
66
60
name : Run audit-ci
67
61
needs : prebuild
98
92
needs : prebuild
99
93
runs-on : ubuntu-latest
100
94
timeout-minutes : 30
95
+ env :
96
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
101
97
steps :
102
98
- uses : actions/checkout@v2
103
99
with :
@@ -108,48 +104,63 @@ jobs:
108
104
with :
109
105
node-version : " 14"
110
106
111
- - name : Fetch dependencies from cache
112
- id : cache-yarn
113
- uses : actions/cache@v2
114
- with :
115
- path : " **/node_modules"
116
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
117
- restore-keys : |
118
- yarn-build-
107
+ # TODO@Teffen investigate why this omits code-oss-dev/node_modules
108
+ # - name: Fetch dependencies from cache
109
+ # id: cache-yarn
110
+ # uses: actions/cache@v2
111
+ # with:
112
+ # path: |
113
+ # "**/node_modules"
114
+ # "**/vendor/modules"
115
+ # "**/vendor/modules/code-oss-dev/node_modules"
116
+ # key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
117
+ # restore-keys: |
118
+ # yarn-build-
119
119
120
120
- name : Install dependencies
121
- if : steps.cache-yarn.outputs.cache-hit != 'true'
121
+ # if: steps.cache-yarn.outputs.cache-hit != 'true'
122
122
run : yarn --frozen-lockfile
123
123
124
124
- name : Build code-server
125
125
run : yarn build
126
126
127
- # Parse the hash of the latest commit inside lib/vscode
127
+ # Parse the hash of the latest commit inside vendor/modules/code-oss-dev
128
128
# use this to avoid rebuilding it if nothing changed
129
129
# How it works: the `git log` command fetches the hash of the last commit
130
- # that changed a file inside `lib/vscode `. If a commit changes any file in there,
130
+ # that changed a file inside `vendor/modules/code-oss-dev `. If a commit changes any file in there,
131
131
# the hash returned will change, and we rebuild vscode. If the hash did not change,
132
132
# (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
133
133
# This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
134
- - name : Get latest lib/vscode rev
134
+ - name : Get latest vendor/modules/code-oss-dev rev
135
135
id : vscode-rev
136
- run : echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode )"
136
+ run : echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|' )"
137
137
138
138
- name : Attempt to fetch vscode build from cache
139
139
id : cache-vscode
140
140
uses : actions/cache@v2
141
141
with :
142
142
path : |
143
- lib/vscode /.build
144
- lib/vscode /out-build
145
- lib/vscode/ out-vscode
146
- lib/vscode/ out-vscode-min
147
- key : vscode-build-${{ steps.vscode-rev.outputs.rev }}
143
+ vendor/modules/code-oss-dev /.build
144
+ vendor/modules/code-oss-dev /out-build
145
+ vendor/modules/code-oss-dev/ out-vscode-server
146
+ vendor/modules/code-oss-dev/ out-vscode-server -min
147
+ key : vscode-server- build-${{ steps.vscode-rev.outputs.rev }}
148
148
149
149
- name : Build vscode
150
150
if : steps.cache-vscode.outputs.cache-hit != 'true'
151
151
run : yarn build:vscode
152
152
153
+ # Our code imports code from VS Code's `out` directory meaning VS Code
154
+ # must be built before running these tests.
155
+ # TODO: Move to its own step?
156
+ - name : Run code-server unit tests
157
+ run : yarn test:unit
158
+ if : success()
159
+
160
+ - name : Upload coverage report to Codecov
161
+ run : yarn coverage
162
+ if : success()
163
+
153
164
# The release package does not contain any native modules
154
165
# and is neutral to architecture/os/libc version.
155
166
- name : Create release package
@@ -240,10 +251,14 @@ jobs:
240
251
# so we just build with "native"/x86_64 node, then download arm64/armv7l node
241
252
# and then put it in our release. We can't smoke test the cross build this way,
242
253
# but this means we don't need to maintain a self-hosted runner!
254
+
255
+ # NOTE@jsjoeio:
256
+ # We used to use 16.04 until GitHub deprecated it on September 20, 2021
257
+ # See here: https://github.com/actions/virtual-environments/pull/3862/files
243
258
package-linux-cross :
244
259
name : Linux cross-compile builds
245
260
needs : build
246
- runs-on : ubuntu-16 .04
261
+ runs-on : ubuntu-18 .04
247
262
timeout-minutes : 15
248
263
strategy :
249
264
matrix :
@@ -275,7 +290,7 @@ jobs:
275
290
echo "$HOME/.local/bin" >> $GITHUB_PATH
276
291
277
292
- name : Install cross-compiler
278
- run : sudo apt install $PACKAGE
293
+ run : sudo apt update && sudo apt install $PACKAGE
279
294
env :
280
295
PACKAGE : ${{ format('g++-{0}', matrix.prefix) }}
281
296
@@ -420,7 +435,7 @@ jobs:
420
435
uses : actions/checkout@v2
421
436
- name : Run Trivy vulnerability scanner in repo mode
422
437
# Commit SHA for v0.0.17
423
- uses : aquasecurity/trivy-action@8eccb5539730451af599c84f444c6d6cf0fc2bb0
438
+ uses : aquasecurity/trivy-action@1ccef265f594a7555a720f623a461a3d69b45bf7
424
439
with :
425
440
scan-type : " fs"
426
441
scan-ref : " ."
0 commit comments