Skip to content

Commit 70496a8

Browse files
committed
WIP: Test Windows CI in a dev drive
1 parent d9c4b8d commit 70496a8

File tree

2 files changed

+53
-18
lines changed

2 files changed

+53
-18
lines changed

.github/workflows/ci.yml

+47-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:
@@ -104,6 +104,26 @@ 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+
# ReFS may have issues with sym links
117+
drive-format: NTFS
118+
119+
- if: contains(matrix.os, 'windows')
120+
name: Delete non-dev drive checkout, to make sure we aren't using it still
121+
run: rm -rf ${{ github.workspace }}
122+
123+
- if: ${{ !contains(matrix.os, 'windows') }}
124+
name: Make sure DEV_DRIVE_WORKSPACE is populated with the workspace
125+
run: echo "DEV_DRIVE_WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV
126+
107127
# Rust Log Analyzer can't currently detect the PR number of a GitHub
108128
# Actions build on its own, so a hint in the log message is needed to
109129
# point it in the right direction.
@@ -115,6 +135,7 @@ jobs:
115135

116136
- name: add extra environment variables
117137
run: src/ci/scripts/setup-environment.sh
138+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
118139
env:
119140
# Since it's not possible to merge `${{ matrix.env }}` with the other
120141
# variables in `job.<name>.env`, the variables defined in the matrix
@@ -124,48 +145,63 @@ jobs:
124145

125146
- name: setup upstream remote
126147
run: src/ci/scripts/setup-upstream-remote.sh
148+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
127149

128150
- name: ensure the channel matches the target branch
129151
run: src/ci/scripts/verify-channel.sh
152+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
130153

131154
- name: collect CPU statistics
132155
run: src/ci/scripts/collect-cpu-stats.sh
156+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
133157

134158
- name: show the current environment
135159
run: src/ci/scripts/dump-environment.sh
160+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
136161

137162
- name: install awscli
138163
run: src/ci/scripts/install-awscli.sh
164+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
139165

140166
- name: install sccache
141167
run: src/ci/scripts/install-sccache.sh
168+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
142169

143170
- name: select Xcode
144171
run: src/ci/scripts/select-xcode.sh
172+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
145173

146174
- name: install clang
147175
run: src/ci/scripts/install-clang.sh
176+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
148177

149178
- name: install tidy
150179
run: src/ci/scripts/install-tidy.sh
180+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
151181

152182
- name: install WIX
153183
run: src/ci/scripts/install-wix.sh
184+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
154185

155186
- name: disable git crlf conversion
156187
run: src/ci/scripts/disable-git-crlf-conversion.sh
188+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
157189

158190
- name: checkout submodules
159191
run: src/ci/scripts/checkout-submodules.sh
192+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
160193

161194
- name: install MinGW
162195
run: src/ci/scripts/install-mingw.sh
196+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
163197

164198
- name: install ninja
165199
run: src/ci/scripts/install-ninja.sh
200+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
166201

167202
- name: enable ipv6 on Docker
168203
run: src/ci/scripts/enable-docker-ipv6.sh
204+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
169205

170206
# Disable automatic line ending conversion (again). On Windows, when we're
171207
# installing dependencies, something switches the git configuration directory or
@@ -174,37 +210,44 @@ jobs:
174210
# appropriate line endings.
175211
- name: disable git crlf conversion
176212
run: src/ci/scripts/disable-git-crlf-conversion.sh
213+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
177214

178215
- name: ensure line endings are correct
179216
run: src/ci/scripts/verify-line-endings.sh
217+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
180218

181219
- name: ensure backported commits are in upstream branches
182220
run: src/ci/scripts/verify-backported-commits.sh
221+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
183222

184223
- name: ensure the stable version number is correct
185224
run: src/ci/scripts/verify-stable-version-number.sh
225+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
186226

187227
- name: run the build
188228
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
189229
run: src/ci/scripts/run-build-from-ci.sh 2>&1
230+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
190231
env:
191232
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
192233
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
193234

194235
- name: create github artifacts
195236
run: src/ci/scripts/create-doc-artifacts.sh
237+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
196238

197239
- name: upload artifacts to github
198240
uses: actions/upload-artifact@v4
199241
with:
200242
# name is set in previous step
201243
name: ${{ env.DOC_ARTIFACT_NAME }}
202-
path: obj/artifacts/doc
244+
path: ${{ env.DEV_DRIVE_WORKSPACE }}obj/artifacts/doc
203245
if-no-files-found: ignore
204246
retention-days: 5
205247

206248
- name: upload artifacts to S3
207249
run: src/ci/scripts/upload-artifacts.sh
250+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
208251
env:
209252
AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
210253
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
@@ -217,6 +260,7 @@ jobs:
217260

218261
- name: upload job metrics to DataDog
219262
if: needs.calculate_matrix.outputs.run_type != 'pr'
263+
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
220264
env:
221265
DATADOG_SITE: datadoghq.com
222266
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
@@ -230,7 +274,7 @@ jobs:
230274
outcome:
231275
name: bors build finished
232276
runs-on: ubuntu-latest
233-
needs: [ calculate_matrix, job ]
277+
needs: [calculate_matrix, job]
234278
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
235279
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
236280
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-4core-16gb
@@ -51,8 +51,7 @@ envs:
5151
NO_DEBUG_ASSERTIONS: 1
5252
NO_OVERFLOW_CHECKS: 1
5353

54-
production:
55-
&production
54+
production: &production
5655
DEPLOY_BUCKET: rust-lang-ci2
5756
# AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
5857
# AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
@@ -84,19 +83,11 @@ envs:
8483
# These jobs automatically inherit envs.pr, to avoid repeating
8584
# it in each job definition.
8685
pr:
87-
- image: mingw-check
88-
<<: *job-linux-4c
89-
- image: mingw-check-tidy
90-
continue_on_error: true
91-
<<: *job-linux-4c
92-
- image: x86_64-gnu-llvm-18
86+
- image: x86_64-msvc
9387
env:
94-
ENABLE_GCC_CODEGEN: "1"
95-
# We are adding (temporarily) a dummy commit on the compiler
96-
READ_ONLY_SRC: "0"
97-
<<: *job-linux-16c
98-
- image: x86_64-gnu-tools
99-
<<: *job-linux-16c
88+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
89+
SCRIPT: make ci-msvc
90+
<<: *job-windows-8c
10091

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

0 commit comments

Comments
 (0)