@@ -182,6 +182,55 @@ jobs:
182
182
if : failure()
183
183
184
184
185
+ test-unit :
186
+ name : Run unit tests
187
+ runs-on : ubuntu-latest
188
+ timeout-minutes : 5
189
+ steps :
190
+ - name : Checkout repo
191
+ uses : actions/checkout@v3
192
+
193
+ - name : Get changed files
194
+ id : changed-files
195
+ uses :
tj-actions/[email protected]
196
+ with :
197
+ files : |
198
+ src/**
199
+
200
+ - name : Install Node.js v16
201
+ if : steps.changed-files.outputs.any_changed == 'true'
202
+ uses : actions/setup-node@v3
203
+ with :
204
+ node-version : " 16"
205
+
206
+ - name : Fetch dependencies from cache
207
+ if : steps.changed-files.outputs.any_changed == 'true'
208
+ id : cache-yarn
209
+ uses : actions/cache@v3
210
+ with :
211
+ path : " node_modules"
212
+ key : yarn-build-${{ hashFiles('yarn.lock') }}
213
+ restore-keys : |
214
+ yarn-build-
215
+
216
+ - name : Install dependencies
217
+ if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-yarn.outputs.cache-hit != 'true'
218
+ run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
219
+
220
+ - name : Run unit tests
221
+ if : steps.changed-files.outputs.any_changed == 'true'
222
+ run : yarn test:unit
223
+
224
+ - name : Upload coverage report to Codecov
225
+ uses : codecov/codecov-action@v3
226
+ with :
227
+ token : ${{ secrets.CODECOV_TOKEN }}
228
+ if : success()
229
+
230
+ - name : Fail workflow
231
+ if : failure()
232
+
233
+
185
234
typecheck :
186
235
name : Check TypeScript types
187
236
runs-on : ubuntu-latest
@@ -292,19 +341,6 @@ jobs:
292
341
if : steps.cache-vscode.outputs.cache-hit != 'true'
293
342
run : yarn build:vscode
294
343
295
- # Our code imports code from VS Code's `out` directory meaning VS Code
296
- # must be built before running these tests.
297
- # TODO: Move to its own step?
298
- - name : Run code-server unit tests
299
- run : yarn test:unit
300
- if : success()
301
-
302
- - name : Upload coverage report to Codecov
303
- uses : codecov/codecov-action@v3
304
- with :
305
- token : ${{ secrets.CODECOV_TOKEN }}
306
- if : success()
307
-
308
344
# The release package does not contain any native modules
309
345
# and is neutral to architecture/os/libc version.
310
346
- name : Create release package
0 commit comments