setup-dev-drive.ps1 785 B

12345678910111213141516171819202122232425
  1. # This creates a 20GB dev drive, and exports all required environment
  2. # variables so that rustup, uv and others all use the dev drive as much
  3. # as possible.
  4. $Volume = New-VHD -Path C:/uv_dev_drive.vhdx -SizeBytes 20GB |
  5. Mount-VHD -Passthru |
  6. Initialize-Disk -Passthru |
  7. New-Partition -AssignDriveLetter -UseMaximumSize |
  8. Format-Volume -FileSystem ReFS -Confirm:$false -Force
  9. Write-Output $Volume
  10. $Drive = "$($Volume.DriveLetter):"
  11. $Tmp = "$($Drive)/uv-tmp"
  12. # Create the directory ahead of time in an attempt to avoid race-conditions
  13. New-Item $Tmp -ItemType Directory
  14. Write-Output `
  15. "DEV_DRIVE=$($Drive)" `
  16. "TMP=$($Tmp)" `
  17. "TEMP=$($Tmp)" `
  18. "RUSTUP_HOME=$($Drive)/.rustup" `
  19. "CARGO_HOME=$($Drive)/.cargo" `
  20. "UV_WORKSPACE=$($Drive)/uv" `
  21. >> $env:GITHUB_ENV