Skip to content

Commit f00128c

Browse files
committed
patch setup-dev-drive
1 parent d119436 commit f00128c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/setup-dev-drive.ps1

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
# the test suite) and we need to create a dev drive. This script automatically
77
# configures the appropriate drive.
88

9-
# Note we use `Get-PSDrive` is not sufficient because the drive letter is assigned.
9+
# Note `Get-PSDrive` is not sufficient because the drive letter is assigned.
1010
if (Test-Path "D:\") {
1111
Write-Output "Using existing drive at D:"
1212
$Drive = "D:"
13-
} else {
13+
# If `New-VHD` is available (as it is on GitHub runners), create a virtual drive
14+
} elseif (Get-Command New-VHD -ErrorAction SilentlyContinue) {
1415
# The size (20 GB) is chosen empirically to be large enough for our
1516
# workflows; larger drives can take longer to set up.
1617
$Volume = New-VHD -Path C:/uv_dev_drive.vhdx -SizeBytes 20GB |
@@ -38,6 +39,11 @@ if (Test-Path "D:\") {
3839
fsutil devdrv query $Drive
3940

4041
Write-Output "Using Dev Drive at $Volume"
42+
# On some runners, i.e., Depot's beta Windows runners — Hyper-V is not available
43+
# and we can't create an optimized drive
44+
} else {
45+
Write-Output "Hyper-V is not available, using existing drive at C:"
46+
$Drive = "C:"
4147
}
4248

4349
$Tmp = "$($Drive)\uv-tmp"

0 commit comments

Comments
 (0)