6060 id : jobs
6161 job :
6262 name : ${{ matrix.name }}
63- needs : [ calculate_matrix ]
63+ needs : [calculate_matrix]
6464 runs-on : " ${{ matrix.os }}"
6565 defaults :
6666 run :
@@ -116,6 +116,25 @@ jobs:
116116 # minutes (and potentially removes important packages).
117117 large-packages : false
118118
119+ - if : contains(matrix.os, 'windows')
120+ uses : samypr100/setup-dev-drive@1d65529cfd809844a9e91e400a560294b6820a68
121+ with :
122+ # use as much space as is sensible, upper github limits are 14gb and 300gb
123+ drive-size : ${{ matrix.os == 'windows-2022' && '12gb' || '100gb' }}
124+ # pre-allocate the space to avoid out of disk errors and improve long-running performance
125+ drive-type : Fixed
126+ # copy the git clone into the dev drive
127+ workspace-copy : true
128+ drive-format : ReFS
129+
130+ - if : contains(matrix.os, 'windows')
131+ name : Delete non-dev drive checkout, to make sure we aren't using it still
132+ run : rm -rf ${{ github.workspace }}
133+
134+ - if : ${{ !contains(matrix.os, 'windows') }}
135+ name : Make sure DEV_DRIVE_WORKSPACE is populated with the workspace
136+ run : echo "DEV_DRIVE_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
137+
119138 # Rust Log Analyzer can't currently detect the PR number of a GitHub
120139 # Actions build on its own, so a hint in the log message is needed to
121140 # point it in the right direction.
@@ -127,6 +146,7 @@ jobs:
127146
128147 - name : add extra environment variables
129148 run : src/ci/scripts/setup-environment.sh
149+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
130150 env :
131151 # Since it's not possible to merge `${{ matrix.env }}` with the other
132152 # variables in `job.<name>.env`, the variables defined in the matrix
@@ -136,48 +156,63 @@ jobs:
136156
137157 - name : setup upstream remote
138158 run : src/ci/scripts/setup-upstream-remote.sh
159+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
139160
140161 - name : ensure the channel matches the target branch
141162 run : src/ci/scripts/verify-channel.sh
163+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
142164
143165 - name : collect CPU statistics
144166 run : src/ci/scripts/collect-cpu-stats.sh
167+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
145168
146169 - name : show the current environment
147170 run : src/ci/scripts/dump-environment.sh
171+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
148172
149173 - name : install awscli
150174 run : src/ci/scripts/install-awscli.sh
175+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
151176
152177 - name : install sccache
153178 run : src/ci/scripts/install-sccache.sh
179+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
154180
155181 - name : select Xcode
156182 run : src/ci/scripts/select-xcode.sh
183+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
157184
158185 - name : install clang
159186 run : src/ci/scripts/install-clang.sh
187+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
160188
161189 - name : install tidy
162190 run : src/ci/scripts/install-tidy.sh
191+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
163192
164193 - name : install WIX
165194 run : src/ci/scripts/install-wix.sh
195+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
166196
167197 - name : disable git crlf conversion
168198 run : src/ci/scripts/disable-git-crlf-conversion.sh
199+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
169200
170201 - name : checkout submodules
171202 run : src/ci/scripts/checkout-submodules.sh
203+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
172204
173205 - name : install MinGW
174206 run : src/ci/scripts/install-mingw.sh
207+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
175208
176209 - name : install ninja
177210 run : src/ci/scripts/install-ninja.sh
211+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
178212
179213 - name : enable ipv6 on Docker
180214 run : src/ci/scripts/enable-docker-ipv6.sh
215+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
181216
182217 # Disable automatic line ending conversion (again). On Windows, when we're
183218 # installing dependencies, something switches the git configuration directory or
@@ -186,25 +221,31 @@ jobs:
186221 # appropriate line endings.
187222 - name : disable git crlf conversion
188223 run : src/ci/scripts/disable-git-crlf-conversion.sh
224+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
189225
190226 - name : ensure line endings are correct
191227 run : src/ci/scripts/verify-line-endings.sh
228+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
192229
193230 - name : ensure backported commits are in upstream branches
194231 run : src/ci/scripts/verify-backported-commits.sh
232+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
195233
196234 - name : ensure the stable version number is correct
197235 run : src/ci/scripts/verify-stable-version-number.sh
236+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
198237
199238 - name : run the build
200239 # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
201240 run : src/ci/scripts/run-build-from-ci.sh 2>&1
241+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
202242 env :
203243 AWS_ACCESS_KEY_ID : ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
204244 AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
205245
206246 - name : create github artifacts
207247 run : src/ci/scripts/create-doc-artifacts.sh
248+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
208249
209250 - name : print disk usage
210251 run : |
@@ -216,12 +257,13 @@ jobs:
216257 with :
217258 # name is set in previous step
218259 name : ${{ env.DOC_ARTIFACT_NAME }}
219- path : obj/artifacts/doc
260+ path : ${{ env.DEV_DRIVE_WORKSPACE }} obj/artifacts/doc
220261 if-no-files-found : ignore
221262 retention-days : 5
222263
223264 - name : upload artifacts to S3
224265 run : src/ci/scripts/upload-artifacts.sh
266+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
225267 env :
226268 AWS_ACCESS_KEY_ID : ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
227269 AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
@@ -234,6 +276,7 @@ jobs:
234276
235277 - name : upload job metrics to DataDog
236278 if : needs.calculate_matrix.outputs.run_type != 'pr'
279+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
237280 env :
238281 DATADOG_SITE : datadoghq.com
239282 DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
@@ -247,7 +290,7 @@ jobs:
247290 outcome :
248291 name : bors build finished
249292 runs-on : ubuntu-latest
250- needs : [ calculate_matrix, job ]
293+ needs : [calculate_matrix, job]
251294 # !cancelled() executes the job regardless of whether the previous jobs passed or failed
252295 if : ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
253296 steps :
0 commit comments