Skip to content

Commit 0d3c1fe

Browse files
committed
WIP: Test Windows CI in a dev drive
1 parent acfdb8d commit 0d3c1fe

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

.github/workflows/ci.yml

+46-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
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:

src/ci/github-actions/jobs.yml

+6-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# dynamically in CI from ci.yml.
33
runners:
44
- &base-job
5-
env: { }
5+
env: {}
66

77
- &job-linux-4c
88
os: ubuntu-20.04
@@ -56,8 +56,7 @@ envs:
5656
NO_DEBUG_ASSERTIONS: 1
5757
NO_OVERFLOW_CHECKS: 1
5858

59-
production:
60-
&production
59+
production: &production
6160
DEPLOY_BUCKET: rust-lang-ci2
6261
# AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
6362
# AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
@@ -89,19 +88,11 @@ envs:
8988
# These jobs automatically inherit envs.pr, to avoid repeating
9089
# it in each job definition.
9190
pr:
92-
- image: mingw-check
93-
<<: *job-linux-4c
94-
- image: mingw-check-tidy
95-
continue_on_error: true
96-
<<: *job-linux-4c
97-
- image: x86_64-gnu-llvm-18
91+
- image: x86_64-msvc
9892
env:
99-
ENABLE_GCC_CODEGEN: "1"
100-
# We are adding (temporarily) a dummy commit on the compiler
101-
READ_ONLY_SRC: "0"
102-
<<: *job-linux-16c
103-
- image: x86_64-gnu-tools
104-
<<: *job-linux-16c
93+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
94+
SCRIPT: make ci-msvc
95+
<<: *job-windows-8c
10596

10697
# Jobs that run when you perform a try build (@bors try)
10798
# These jobs automatically inherit envs.try, to avoid repeating

0 commit comments

Comments
 (0)