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 :
@@ -104,6 +104,24 @@ jobs:
104104 with :
105105 fetch-depth : 2
106106
107+ - if : contains(matrix.os, 'windows')
108+ uses : samypr100/setup-dev-drive@1d65529cfd809844a9e91e400a560294b6820a68
109+ with :
110+ # use as much space as is sensible, upper github limits are 14gb and 300gb
111+ drive-size : ${{ matrix.os == 'windows-2022' && '12gb' || '100gb' }}
112+ # pre-allocate the space to avoid out of disk errors and improve long-running performance
113+ drive-type : Fixed
114+ # copy the git clone into the dev drive
115+ workspace-copy : true
116+
117+ - if : contains(matrix.os, 'windows')
118+ name : Delete NTFS checkout, to make sure we aren't using it still
119+ run : rm -rf ${{ github.workspace }}
120+
121+ - if : ${{ !contains(matrix.os, 'windows') }}
122+ name : Make sure DEV_DRIVE_WORKSPACE is populated with the workspace
123+ run : echo "DEV_DRIVE_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
124+
107125 # Rust Log Analyzer can't currently detect the PR number of a GitHub
108126 # Actions build on its own, so a hint in the log message is needed to
109127 # point it in the right direction.
@@ -115,6 +133,7 @@ jobs:
115133
116134 - name : add extra environment variables
117135 run : src/ci/scripts/setup-environment.sh
136+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
118137 env :
119138 # Since it's not possible to merge `${{ matrix.env }}` with the other
120139 # variables in `job.<name>.env`, the variables defined in the matrix
@@ -124,48 +143,63 @@ jobs:
124143
125144 - name : setup upstream remote
126145 run : src/ci/scripts/setup-upstream-remote.sh
146+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
127147
128148 - name : ensure the channel matches the target branch
129149 run : src/ci/scripts/verify-channel.sh
150+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
130151
131152 - name : collect CPU statistics
132153 run : src/ci/scripts/collect-cpu-stats.sh
154+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
133155
134156 - name : show the current environment
135157 run : src/ci/scripts/dump-environment.sh
158+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
136159
137160 - name : install awscli
138161 run : src/ci/scripts/install-awscli.sh
162+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
139163
140164 - name : install sccache
141165 run : src/ci/scripts/install-sccache.sh
166+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
142167
143168 - name : select Xcode
144169 run : src/ci/scripts/select-xcode.sh
170+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
145171
146172 - name : install clang
147173 run : src/ci/scripts/install-clang.sh
174+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
148175
149176 - name : install tidy
150177 run : src/ci/scripts/install-tidy.sh
178+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
151179
152180 - name : install WIX
153181 run : src/ci/scripts/install-wix.sh
182+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
154183
155184 - name : disable git crlf conversion
156185 run : src/ci/scripts/disable-git-crlf-conversion.sh
186+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
157187
158188 - name : checkout submodules
159189 run : src/ci/scripts/checkout-submodules.sh
190+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
160191
161192 - name : install MinGW
162193 run : src/ci/scripts/install-mingw.sh
194+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
163195
164196 - name : install ninja
165197 run : src/ci/scripts/install-ninja.sh
198+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
166199
167200 - name : enable ipv6 on Docker
168201 run : src/ci/scripts/enable-docker-ipv6.sh
202+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
169203
170204 # Disable automatic line ending conversion (again). On Windows, when we're
171205 # installing dependencies, something switches the git configuration directory or
@@ -174,37 +208,44 @@ jobs:
174208 # appropriate line endings.
175209 - name : disable git crlf conversion
176210 run : src/ci/scripts/disable-git-crlf-conversion.sh
211+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
177212
178213 - name : ensure line endings are correct
179214 run : src/ci/scripts/verify-line-endings.sh
215+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
180216
181217 - name : ensure backported commits are in upstream branches
182218 run : src/ci/scripts/verify-backported-commits.sh
219+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
183220
184221 - name : ensure the stable version number is correct
185222 run : src/ci/scripts/verify-stable-version-number.sh
223+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
186224
187225 - name : run the build
188226 # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
189227 run : src/ci/scripts/run-build-from-ci.sh 2>&1
228+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
190229 env :
191230 AWS_ACCESS_KEY_ID : ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
192231 AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
193232
194233 - name : create github artifacts
195234 run : src/ci/scripts/create-doc-artifacts.sh
235+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
196236
197237 - name : upload artifacts to github
198238 uses : actions/upload-artifact@v4
199239 with :
200240 # name is set in previous step
201241 name : ${{ env.DOC_ARTIFACT_NAME }}
202- path : obj/artifacts/doc
242+ path : ${{ env.DEV_DRIVE_WORKSPACE }} obj/artifacts/doc
203243 if-no-files-found : ignore
204244 retention-days : 5
205245
206246 - name : upload artifacts to S3
207247 run : src/ci/scripts/upload-artifacts.sh
248+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
208249 env :
209250 AWS_ACCESS_KEY_ID : ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
210251 AWS_SECRET_ACCESS_KEY : ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
@@ -217,6 +258,7 @@ jobs:
217258
218259 - name : upload job metrics to DataDog
219260 if : needs.calculate_matrix.outputs.run_type != 'pr'
261+ working-directory : ${{ env.DEV_DRIVE_WORKSPACE }}
220262 env :
221263 DATADOG_SITE : datadoghq.com
222264 DATADOG_API_KEY : ${{ secrets.DATADOG_API_KEY }}
@@ -230,7 +272,7 @@ jobs:
230272 outcome :
231273 name : bors build finished
232274 runs-on : ubuntu-latest
233- needs : [ calculate_matrix, job ]
275+ needs : [calculate_matrix, job]
234276 # !cancelled() executes the job regardless of whether the previous jobs passed or failed
235277 if : ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
236278 steps :
0 commit comments