Skip to content

Commit 1cb6beb

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

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

+6-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,9 @@ if (Test-Path "D:\") {
3839
fsutil devdrv query $Drive
3940

4041
Write-Output "Using Dev Drive at $Volume"
42+
} else {
43+
Write-Output "Hyper-V is not available, using existing drive at C:"
44+
$Drive = "C:"
4145
}
4246

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

0 commit comments

Comments
 (0)