45
45
46
46
- name : Get changed files
47
47
id : changed-files
48
- uses : tj-actions/changed-files@v26.1
48
+ uses : tj-actions/changed-files@v36
49
49
with :
50
50
files : |
51
51
docs/**
@@ -76,14 +76,14 @@ jobs:
76
76
77
77
- name : Get changed files
78
78
id : changed-files
79
- uses : tj-actions/changed-files@v26.1
79
+ uses : tj-actions/changed-files@v36
80
80
with :
81
81
files : |
82
82
ci/helm-chart/**
83
83
84
84
- name : Install helm
85
85
if : steps.changed-files.outputs.any_changed == 'true'
86
- uses : azure/setup-helm@v3.4
86
+ uses : azure/setup-helm@v3.5
87
87
with :
88
88
token : ${{ secrets.GITHUB_TOKEN }}
89
89
@@ -107,7 +107,7 @@ jobs:
107
107
108
108
- name : Get changed files
109
109
id : changed-files
110
- uses : tj-actions/changed-files@v26.1
110
+ uses : tj-actions/changed-files@v36
111
111
with :
112
112
files : |
113
113
**/*.ts
@@ -139,6 +139,67 @@ jobs:
139
139
if : steps.changed-files.outputs.any_changed == 'true'
140
140
run : yarn lint:ts
141
141
142
+ lint-actions :
143
+ name : Lint GitHub Actions
144
+ runs-on : ubuntu-latest
145
+ steps :
146
+ - name : Checkout repo
147
+ uses : actions/checkout@v3
148
+ - name : Check workflow files
149
+ run : |
150
+ bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
151
+ ./actionlint -color -shellcheck= -ignore "set-output"
152
+ shell : bash
153
+
154
+ test-unit :
155
+ name : Run unit tests
156
+ runs-on : ubuntu-20.04
157
+ timeout-minutes : 5
158
+ steps :
159
+ - name : Checkout repo
160
+ uses : actions/checkout@v3
161
+ with :
162
+ fetch-depth : 2
163
+
164
+ - name : Get changed files
165
+ id : changed-files
166
+ uses : tj-actions/changed-files@v36
167
+ with :
168
+ files : |
169
+ **/*.ts
170
+ files_ignore : |
171
+ lib/vscode/**
172
+
173
+ - name : Install Node.js v16
174
+ if : steps.changed-files.outputs.any_changed == 'true'
175
+ uses : actions/setup-node@v3
176
+ with :
177
+ node-version : " 16"
178
+
179
+ - name : Fetch dependencies from cache
180
+ if : steps.changed-files.outputs.any_changed == 'true'
181
+ id : cache-node-modules
182
+ uses : actions/cache@v3
183
+ with :
184
+ path : " **/node_modules"
185
+ key : yarn-build-${{ hashFiles('**/yarn.lock') }}
186
+ restore-keys : |
187
+ yarn-build-
188
+
189
+ - name : Install dependencies
190
+ if : steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
191
+ run : SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
192
+
193
+ - name : Run unit tests
194
+ if : steps.changed-files.outputs.any_changed == 'true'
195
+ run : yarn test:unit
196
+
197
+ - name : Upload coverage report to Codecov
198
+ uses : codecov/codecov-action@v3
199
+ with :
200
+ token : ${{ secrets.CODECOV_TOKEN }}
201
+ if : success()
202
+
142
203
build :
143
204
name : Build code-server
144
205
runs-on : ubuntu-20.04
@@ -170,22 +231,24 @@ jobs:
170
231
uses : actions/cache@v3
171
232
with :
172
233
path : " **/node_modules"
173
- key : yarn-build-${{ hashFiles('**/yarn.lock') }}
234
+ key : yarn-build-code-server- ${{ hashFiles('**/yarn.lock') }}
174
235
restore-keys : |
175
- yarn-build-
236
+ yarn-build-code-server-
176
237
177
238
- name : Install dependencies
178
239
if : steps.cache-node-modules.outputs.cache-hit != 'true'
179
240
run : yarn --frozen-lockfile
180
241
181
242
- name : Build code-server
243
+ env :
244
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
182
245
run : yarn build
183
246
184
247
# Get Code's git hash. When this changes it means the content is
185
248
# different and we need to rebuild.
186
249
- name : Get latest lib/vscode rev
187
250
id : vscode-rev
188
- run : echo "::set-output name= rev:: $(git rev-parse HEAD:./lib/vscode)"
251
+ run : echo "rev= $(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
189
252
190
253
# We need to rebuild when we have a new version of Code, when any of
191
254
# the patches changed, or when the code-server version changes (since
@@ -204,19 +267,6 @@ jobs:
204
267
if : steps.cache-vscode.outputs.cache-hit != 'true'
205
268
run : yarn build:vscode
206
269
207
- # Our code imports code from VS Code's `out` directory meaning VS Code
208
- # must be built before running these tests.
209
- # TODO: Move to its own step?
210
- - name : Run code-server unit tests
211
- run : yarn test:unit
212
- if : success()
213
-
214
- - name : Upload coverage report to Codecov
215
- uses : codecov/codecov-action@v3
216
- with :
217
- token : ${{ secrets.CODECOV_TOKEN }}
218
- if : success()
219
-
220
270
# The release package does not contain any native modules
221
271
# and is neutral to architecture/os/libc version.
222
272
- name : Create release package
@@ -233,65 +283,6 @@ jobs:
233
283
name : npm-package
234
284
path : ./package.tar.gz
235
285
236
- npm :
237
- name : Publish npm package
238
- # the npm-package gets uploaded as an artifact in Build
239
- # so we need that to complete before this runs
240
- needs : build
241
- # This environment "npm" requires someone from
242
- # coder/code-server-reviewers to approve the PR before this job runs.
243
- environment : npm
244
- # Only run if PR comes from base repo or event is not a PR
245
- # Reason: forks cannot access secrets and this will always fail
246
- if : github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
247
- runs-on : ubuntu-20.04
248
- steps :
249
- - name : Checkout repo
250
- uses : actions/checkout@v3
251
-
252
- - name : Download artifact
253
- uses : actions/download-artifact@v3
254
- id : download
255
- with :
256
- name : " npm-package"
257
- path : release-npm-package
258
-
259
- - name : Run ./ci/steps/publish-npm.sh
260
- run : yarn publish:npm
261
- env :
262
- # NOTE@jsjoeio
263
- # This is because npm enforces semantic versioning
264
- # so it has to be a valid version. We only use this
265
- # to publish dev versions from prs
266
- # and beta versions from main.
267
- VERSION : " 0.0.0"
268
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
269
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
270
- # NOTE@jsjoeio
271
- # NPM_ENVIRONMENT intentionally not set here.
272
- # Instead, itis determined in publish-npm.sh script
273
- # using GITHUB environment variables
274
-
275
- - name : Comment npm information
276
- uses : marocchino/sticky-pull-request-comment@v2
277
- with :
278
- GITHUB_TOKEN : ${{ github.token }}
279
- header : npm-dev-build
280
- message : |
281
- ✨ code-server dev build published to npm for PR #${{ github.event.number }}!
282
- * _Last publish status_: success
283
- * _Commit_: ${{ github.event.pull_request.head.sha }}
284
-
285
- To install in a local project, run:
286
- ```shell-session
287
- npm install @coder/code-server-pr@${{ github.event.number }}
288
- ```
289
-
290
- To install globally, run:
291
- ```shell-session
292
- npm install -g @coder/code-server-pr@${{ github.event.number }}
293
- ```
294
-
295
286
test-e2e :
296
287
name : Run e2e tests
297
288
needs : build
@@ -336,7 +327,7 @@ jobs:
336
327
./test/node_modules/.bin/playwright install
337
328
338
329
- name : Run end-to-end tests
339
- run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
330
+ run : CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
340
331
341
332
- name : Upload test artifacts
342
333
if : always()
@@ -392,7 +383,7 @@ jobs:
392
383
./test/node_modules/.bin/playwright install
393
384
394
385
- name : Cache Caddy
395
- uses : actions/cache@v2
386
+ uses : actions/cache@v3
396
387
id : caddy-cache
397
388
with :
398
389
path : |
@@ -405,7 +396,7 @@ jobs:
405
396
if : steps.caddy-cache.outputs.cache-hit != 'true'
406
397
run : |
407
398
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
408
- mkdir -p ~/.cache/caddy
399
+ mkdir -p ~/.cache/caddy
409
400
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
410
401
411
402
- name : Start Caddy
0 commit comments