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
@@ -102,6 +117,7 @@ jobs:
102
117
done
103
118
104
119
typescript :
120
+ needs : changes
105
121
if : github.repository == 'rust-lang/rust-analyzer'
106
122
name : TypeScript
107
123
strategy :
@@ -114,45 +130,51 @@ jobs:
114
130
steps :
115
131
- name : Checkout repository
116
132
uses : actions/checkout@v3
133
+ if : needs.changes.outputs.typescript == 'true'
117
134
118
135
- name : Install Nodejs
119
136
uses : actions/setup-node@v3
120
137
with :
121
138
node-version : 16
139
+ if : needs.changes.outputs.typescript == 'true'
122
140
123
141
- name : Install xvfb
124
- if : matrix.os == 'ubuntu-latest'
142
+ if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
125
143
run : sudo apt-get install -y xvfb
126
144
127
145
- run : npm ci
128
146
working-directory : ./editors/code
147
+ if : needs.changes.outputs.typescript == 'true'
129
148
130
149
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
131
150
# if: runner.os == 'Linux'
132
151
# working-directory: ./editors/code
133
152
134
153
- run : npm run lint
135
154
working-directory : ./editors/code
155
+ if : needs.changes.outputs.typescript == 'true'
136
156
137
157
- name : Run VS Code tests (Linux)
138
- if : matrix.os == 'ubuntu-latest'
158
+ if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
139
159
env :
140
160
VSCODE_CLI : 1
141
161
run : xvfb-run npm test
142
162
working-directory : ./editors/code
143
163
144
164
- name : Run VS Code tests (Windows)
145
- if : matrix.os == 'windows-latest'
165
+ if : matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
146
166
env :
147
167
VSCODE_CLI : 1
148
168
run : npm test
149
169
working-directory : ./editors/code
150
170
151
171
- run : npm run pretest
152
172
working-directory : ./editors/code
173
+ if : needs.changes.outputs.typescript == 'true'
153
174
154
175
- run : npm run package --scripts-prepend-node-path
155
176
working-directory : ./editors/code
177
+ if : needs.changes.outputs.typescript == 'true'
156
178
157
179
end-success :
158
180
name : bors build finished
@@ -165,7 +187,7 @@ jobs:
165
187
166
188
end-failure :
167
189
name : bors build finished
168
- if : github.event.pusher.name == 'bors' && (failure() || cancelled() )
190
+ if : github.event.pusher.name == 'bors' && !success( )
169
191
runs-on : ubuntu-latest
170
192
needs : [rust, rust-cross, typescript]
171
193
steps :
0 commit comments