@@ -127,48 +127,68 @@ jobs:
127
127
cargo check -p ide --target=$target --all-targets
128
128
done
129
129
130
- typescript :
130
+ typescript-format :
131
131
needs : changes
132
132
if : github.repository == 'rust-lang/rust-analyzer'
133
- name : TypeScript
134
- strategy :
135
- fail-fast : false
136
- matrix :
137
- os : [ubuntu-latest, windows-latest]
138
-
139
- runs-on : ${{ matrix.os }}
140
-
133
+ runs-on : ubuntu-latest
141
134
steps :
142
135
- name : Checkout repository
143
136
uses : actions/checkout@v3
144
137
if : needs.changes.outputs.typescript == 'true'
145
138
146
- - name : Install Nodejs
147
- uses : actions/setup-node@v3
139
+ - name : Setup Node.js
140
+ uses : ./.github/ actions/prepare-typescript
148
141
with :
149
- node-version : 16
142
+ working-directory : ./editors/code
150
143
if : needs.changes.outputs.typescript == 'true'
151
144
152
- - name : Install xvfb
153
- if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
154
- run : sudo apt-get install -y xvfb
155
-
156
- - run : npm ci
145
+ # To fix this steps, please run `npm run format`.
146
+ - run : npm run format:check
157
147
working-directory : ./editors/code
158
148
if : needs.changes.outputs.typescript == 'true'
159
149
160
- # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
161
- # if: runner.os == 'Linux'
162
- # working-directory: ./editors/code
150
+ typescript-lint :
151
+ needs : changes
152
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
153
+ runs-on : ubuntu-latest
154
+ steps :
155
+ - name : Checkout repository
156
+ uses : actions/checkout@v3
157
+ if : needs.changes.outputs.typescript == 'true'
158
+
159
+ - name : Setup Node.js
160
+ uses : ./.github/actions/prepare-typescript
161
+ with :
162
+ working-directory : ./editors/code
163
+ if : needs.changes.outputs.typescript == 'true'
163
164
164
165
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
165
166
- run : npm run lint
166
167
working-directory : ./editors/code
167
168
if : needs.changes.outputs.typescript == 'true'
168
169
169
- # To fix this steps, please run `npm run format`.
170
- - run : npm run format:check
171
- working-directory : ./editors/code
170
+ typescript-test :
171
+ needs : changes
172
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
173
+ strategy :
174
+ fail-fast : false
175
+ matrix :
176
+ os : [ubuntu-latest, windows-latest]
177
+
178
+ runs-on : ${{ matrix.os }}
179
+ steps :
180
+ - name : Checkout repository
181
+ uses : actions/checkout@v3
182
+ if : needs.changes.outputs.typescript == 'true'
183
+
184
+ - name : Install xvfb
185
+ if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
186
+ run : sudo apt-get install -y xvfb
187
+
188
+ - name : Setup Node.js
189
+ uses : ./.github/actions/prepare-typescript
190
+ with :
191
+ working-directory : ./editors/code
172
192
if : needs.changes.outputs.typescript == 'true'
173
193
174
194
- name : Run VS Code tests (Linux)
@@ -178,9 +198,26 @@ jobs:
178
198
run : xvfb-run npm test
179
199
working-directory : ./editors/code
180
200
181
- # To fix this steps, please run `npm run format`.
182
- - run : npm run format:check
201
+ - name : Run VS Code tests (Windows)
202
+ if : matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
203
+ env :
204
+ VSCODE_CLI : 1
205
+ run : npm test
183
206
working-directory : ./editors/code
207
+
208
+ typescript-build :
209
+ needs : changes
210
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
211
+ runs-on : ubuntu-latest
212
+ steps :
213
+ - name : Checkout repository
214
+ uses : actions/checkout@v3
215
+ if : needs.changes.outputs.typescript == 'true'
216
+
217
+ - name : Setup Node.js
218
+ uses : ./.github/actions/prepare-typescript
219
+ with :
220
+ working-directory : ./editors/code
184
221
if : needs.changes.outputs.typescript == 'true'
185
222
186
223
# If this steps fails, your code's type integrity might be wrong at some places.
@@ -191,12 +228,20 @@ jobs:
191
228
working-directory : ./editors/code
192
229
if : needs.changes.outputs.typescript == 'true'
193
230
194
- - name : Run VS Code tests (Windows)
195
- if : matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
196
- env :
197
- VSCODE_CLI : 1
198
- run : npm test
199
- working-directory : ./editors/code
231
+ typescript-package :
232
+ needs : changes
233
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
234
+ runs-on : ubuntu-latest
235
+ steps :
236
+ - name : Checkout repository
237
+ uses : actions/checkout@v3
238
+ if : needs.changes.outputs.typescript == 'true'
239
+
240
+ - name : Setup Node.js
241
+ uses : ./.github/actions/prepare-typescript
242
+ with :
243
+ working-directory : ./editors/code
244
+ if : needs.changes.outputs.typescript == 'true'
200
245
201
246
- run : npm run package --scripts-prepend-node-path
202
247
working-directory : ./editors/code
@@ -206,7 +251,15 @@ jobs:
206
251
name : bors build finished
207
252
if : github.event.pusher.name == 'bors' && success()
208
253
runs-on : ubuntu-latest
209
- needs : [rust, rust-cross, typescript]
254
+ needs :
255
+ - rust
256
+ - rust-cross
257
+ - typescript-format
258
+ - typescript-lint
259
+ - typescript-build
260
+ - typescript-test
261
+ - typescript-package
262
+
210
263
steps :
211
264
- name : Mark the job as successful
212
265
run : exit 0
@@ -215,7 +268,14 @@ jobs:
215
268
name : bors build finished
216
269
if : github.event.pusher.name == 'bors' && !success()
217
270
runs-on : ubuntu-latest
218
- needs : [rust, rust-cross, typescript]
271
+ needs :
272
+ - rust
273
+ - rust-cross
274
+ - typescript-format
275
+ - typescript-lint
276
+ - typescript-build
277
+ - typescript-test
278
+ - typescript-package
219
279
steps :
220
280
- name : Mark the job as a failure
221
281
run : exit 1
0 commit comments