@@ -112,6 +112,32 @@ jobs:
112
112
uses : jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
113
113
if : matrix.free_disk
114
114
115
+ # Use dev drive on Windows CI in the hopes that this makes spurious
116
+ # files-held-by-another-process failures less likely.
117
+ # cf. <https://github.com/samypr100/setup-dev-drive>
118
+ - if : contains(matrix.os, 'windows')
119
+ uses : samypr100/setup-dev-drive@1d65529cfd809844a9e91e400a560294b6820a68
120
+ with :
121
+ # Use as much space as is sensible, upper github limits are 14gb and
122
+ # 300gb.
123
+ drive-size : ${{ matrix.os == 'windows-2022' && '12gb' || '100gb' }}
124
+ # Pre-allocate the space to avoid out of disk errors and improve
125
+ # long-running performance.
126
+ drive-type : Fixed
127
+ # Copy the git clone into the dev drive.
128
+ workspace-copy : true
129
+ # NOTE: rustc build was failing on stage2 mysteriously when #131880
130
+ # tried to use ReFS. Trying NTFS here instead.
131
+ drive-format : NTFS
132
+
133
+ - if : contains(matrix.os, 'windows')
134
+ name : Delete non-dev drive checkout, to make sure we aren't using it still
135
+ run : rm -rf ${{ github.workspace }}
136
+
137
+ - if : ${{ !contains(matrix.os, 'windows') }}
138
+ name : Make sure DEV_DRIVE_WORKSPACE is populated with the workspace
139
+ run : echo "DEV_DRIVE_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
140
+
115
141
# Rust Log Analyzer can't currently detect the PR number of a GitHub
116
142
# Actions build on its own, so a hint in the log message is needed to
117
143
# point it in the right direction.
@@ -123,6 +149,7 @@ jobs:
123
149
124
150
- name : add extra environment variables
125
151
run : src/ci/scripts/setup-environment.sh
152
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
126
153
env :
127
154
# Since it's not possible to merge `${{ matrix.env }}` with the other
128
155
# variables in `job.<name>.env`, the variables defined in the matrix
@@ -132,48 +159,63 @@ jobs:
132
159
133
160
- name : setup upstream remote
134
161
run : src/ci/scripts/setup-upstream-remote.sh
162
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
135
163
136
164
- name : ensure the channel matches the target branch
137
165
run : src/ci/scripts/verify-channel.sh
166
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
138
167
139
168
- name : collect CPU statistics
140
169
run : src/ci/scripts/collect-cpu-stats.sh
170
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
141
171
142
172
- name : show the current environment
143
173
run : src/ci/scripts/dump-environment.sh
174
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
144
175
145
176
- name : install awscli
146
177
run : src/ci/scripts/install-awscli.sh
178
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
147
179
148
180
- name : install sccache
149
181
run : src/ci/scripts/install-sccache.sh
182
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
150
183
151
184
- name : select Xcode
152
185
run : src/ci/scripts/select-xcode.sh
186
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
153
187
154
188
- name : install clang
155
189
run : src/ci/scripts/install-clang.sh
190
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
156
191
157
192
- name : install tidy
158
193
run : src/ci/scripts/install-tidy.sh
194
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
159
195
160
196
- name : install WIX
161
197
run : src/ci/scripts/install-wix.sh
198
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
162
199
163
200
- name : disable git crlf conversion
164
201
run : src/ci/scripts/disable-git-crlf-conversion.sh
202
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
165
203
166
204
- name : checkout submodules
167
205
run : src/ci/scripts/checkout-submodules.sh
206
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
168
207
169
208
- name : install MinGW
170
209
run : src/ci/scripts/install-mingw.sh
210
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
171
211
172
212
- name : install ninja
173
213
run : src/ci/scripts/install-ninja.sh
214
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
174
215
175
216
- name : enable ipv6 on Docker
176
217
run : src/ci/scripts/enable-docker-ipv6.sh
218
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
177
219
178
220
# Disable automatic line ending conversion (again). On Windows, when we're
179
221
# installing dependencies, something switches the git configuration directory or
@@ -182,25 +224,31 @@ jobs:
182
224
# appropriate line endings.
183
225
- name : disable git crlf conversion
184
226
run : src/ci/scripts/disable-git-crlf-conversion.sh
227
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
185
228
186
229
- name : ensure line endings are correct
187
230
run : src/ci/scripts/verify-line-endings.sh
231
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
188
232
189
233
- name : ensure backported commits are in upstream branches
190
234
run : src/ci/scripts/verify-backported-commits.sh
235
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
191
236
192
237
- name : ensure the stable version number is correct
193
238
run : src/ci/scripts/verify-stable-version-number.sh
239
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
194
240
195
241
- name : run the build
196
242
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
197
243
run : src/ci/scripts/run-build-from-ci.sh 2>&1
244
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
198
245
env :
199
246
AWS_ACCESS_KEY_ID : ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
200
247
AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
201
248
202
249
- name : create github artifacts
203
250
run : src/ci/scripts/create-doc-artifacts.sh
251
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
204
252
205
253
- name : print disk usage
206
254
run : |
@@ -212,12 +260,13 @@ jobs:
212
260
with :
213
261
# name is set in previous step
214
262
name : ${{ env.DOC_ARTIFACT_NAME }}
215
- path : obj/artifacts/doc
263
+ path : ${{ env.DEV_DRIVE_WORKSPACE }} obj/artifacts/doc
216
264
if-no-files-found : ignore
217
265
retention-days : 5
218
266
219
267
- name : upload artifacts to S3
220
268
run : src/ci/scripts/upload-artifacts.sh
269
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
221
270
env :
222
271
AWS_ACCESS_KEY_ID : ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
223
272
AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
@@ -230,6 +279,7 @@ jobs:
230
279
231
280
- name : upload job metrics to DataDog
232
281
if : needs.calculate_matrix.outputs.run_type != 'pr'
282
+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
233
283
env :
234
284
DATADOG_SITE : datadoghq.com
235
285
DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
@@ -243,7 +293,7 @@ jobs:
243
293
outcome :
244
294
name : bors build finished
245
295
runs-on : ubuntu-latest
246
- needs : [ calculate_matrix, job ]
296
+ needs : [calculate_matrix, job]
247
297
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
248
298
if : ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
249
299
steps :
0 commit comments