mirror of
https://github.com/openai/codex.git
synced 2026-05-17 09:43:19 +00:00
Make Windows Dev Drive setup use existing volumes
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
29
.github/scripts/setup-dev-drive.ps1
vendored
29
.github/scripts/setup-dev-drive.ps1
vendored
@@ -1,35 +1,14 @@
|
||||
# Configure a fast drive for Windows CI jobs.
|
||||
#
|
||||
# If the runner already exposes `D:`, prefer it directly. Otherwise create a
|
||||
# small Dev Drive VHD and use that mount point for temp-heavy work.
|
||||
# If the runner already exposes `D:`, prefer it directly. Otherwise fall back
|
||||
# to `C:` without trying to provision a new volume in CI.
|
||||
|
||||
if (Test-Path "D:\") {
|
||||
Write-Output "Using existing drive at D:"
|
||||
$Drive = "D:"
|
||||
} else {
|
||||
try {
|
||||
$VhdPath = "C:/codex_dev_drive.vhdx"
|
||||
$Volume = New-VHD -Path $VhdPath -SizeBytes 20GB -ErrorAction Stop |
|
||||
Mount-VHD -Passthru -ErrorAction Stop |
|
||||
Initialize-Disk -Passthru -ErrorAction Stop |
|
||||
New-Partition -AssignDriveLetter -UseMaximumSize -ErrorAction Stop |
|
||||
Format-Volume -DevDrive -Confirm:$false -Force -ErrorAction Stop
|
||||
|
||||
$Drive = "$($Volume.DriveLetter):"
|
||||
|
||||
fsutil devdrv trust $Drive
|
||||
fsutil devdrv enable /disallowAv
|
||||
|
||||
Dismount-VHD -Path $VhdPath
|
||||
Mount-VHD -Path $VhdPath
|
||||
|
||||
Write-Output $Volume
|
||||
fsutil devdrv query $Drive
|
||||
Write-Output "Using Dev Drive at $Drive"
|
||||
} catch {
|
||||
Write-Warning "Failed to create Dev Drive, falling back to C:. $($_.Exception.Message)"
|
||||
$Drive = "C:"
|
||||
}
|
||||
Write-Warning "No D: drive available; falling back to C:"
|
||||
$Drive = "C:"
|
||||
}
|
||||
|
||||
$Tmp = "$Drive\codex-tmp"
|
||||
|
||||
Reference in New Issue
Block a user