Windows tests on self-hosted runners (#29764)

Windows self-hosted runners

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Junkui Zhang <364772080@qq.com>
This commit is contained in:
Peter Tripp 2025-06-16 17:29:36 -04:00 committed by GitHub
parent 701fa4daa8
commit 1f457169ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 105 additions and 99 deletions

View file

@ -0,0 +1,22 @@
param (
[Parameter(Mandatory = $true)]
[int]$MAX_SIZE_IN_GB
)
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$ProgressPreference = "SilentlyContinue"
if (-Not (Test-Path -Path "target")) {
Write-Host "target directory does not exist yet"
exit 0
}
$current_size_gb = (Get-ChildItem -Recurse -Force -File -Path "target" | Measure-Object -Property Length -Sum).Sum / 1GB
Write-Host "target directory size: ${current_size_gb}GB. max size: ${MAX_SIZE_IN_GB}GB"
if ($current_size_gb -gt $MAX_SIZE_IN_GB) {
Write-Host "clearing target directory"
Remove-Item -Recurse -Force -Path "target\*"
}