18
18
RUSTUP_MAX_RETRIES : 10
19
19
20
20
jobs :
21
+ changes :
22
+ runs-on : ubuntu-latest
23
+ permissions :
24
+ pull-requests : read
25
+ outputs :
26
+ typescript : ${{ steps.filter.outputs.typescript }}
27
+ steps :
28
+ - uses : actions/checkout@v3
29
+ - uses : dorny/paths-filter@v2
30
+ id : filter
31
+ with :
32
+ filters : |
33
+ typescript:
34
+ - 'editors/code/**'
35
+
21
36
rust :
22
37
if : github.repository == 'rust-lang/rust-analyzer'
23
38
name : Rust
@@ -105,6 +120,7 @@ jobs:
105
120
done
106
121
107
122
typescript :
123
+ needs : changes
108
124
if : github.repository == 'rust-lang/rust-analyzer'
109
125
name : TypeScript
110
126
strategy :
@@ -117,45 +133,51 @@ jobs:
117
133
steps :
118
134
- name : Checkout repository
119
135
uses : actions/checkout@v3
136
+ if : needs.changes.outputs.typescript == 'true'
120
137
121
138
- name : Install Nodejs
122
139
uses : actions/setup-node@v3
123
140
with :
124
141
node-version : 16
142
+ if : needs.changes.outputs.typescript == 'true'
125
143
126
144
- name : Install xvfb
127
- if : matrix.os == 'ubuntu-latest'
145
+ if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
128
146
run : sudo apt-get install -y xvfb
129
147
130
148
- run : npm ci
131
149
working-directory : ./editors/code
150
+ if : needs.changes.outputs.typescript == 'true'
132
151
133
152
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
134
153
# if: runner.os == 'Linux'
135
154
# working-directory: ./editors/code
136
155
137
156
- run : npm run lint
138
157
working-directory : ./editors/code
158
+ if : needs.changes.outputs.typescript == 'true'
139
159
140
160
- name : Run VS Code tests (Linux)
141
- if : matrix.os == 'ubuntu-latest'
161
+ if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
142
162
env :
143
163
VSCODE_CLI : 1
144
164
run : xvfb-run npm test
145
165
working-directory : ./editors/code
146
166
147
167
- name : Run VS Code tests (Windows)
148
- if : matrix.os == 'windows-latest'
168
+ if : matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
149
169
env :
150
170
VSCODE_CLI : 1
151
171
run : npm test
152
172
working-directory : ./editors/code
153
173
154
174
- run : npm run pretest
155
175
working-directory : ./editors/code
176
+ if : needs.changes.outputs.typescript == 'true'
156
177
157
178
- run : npm run package --scripts-prepend-node-path
158
179
working-directory : ./editors/code
180
+ if : needs.changes.outputs.typescript == 'true'
159
181
160
182
end-success :
161
183
name : bors build finished
@@ -168,7 +190,7 @@ jobs:
168
190
169
191
end-failure :
170
192
name : bors build finished
171
- if : github.event.pusher.name == 'bors' && (failure() || cancelled() )
193
+ if : github.event.pusher.name == 'bors' && !success( )
172
194
runs-on : ubuntu-latest
173
195
needs : [rust, rust-cross, typescript]
174
196
steps :
0 commit comments