Skip to content

Commit

Permalink
Backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Mar 4, 2025
1 parent a6399ab commit 3a87f3d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,24 +386,26 @@ jobs:
if [[ "${{matrix.TARGET}}" == win ]]; then
powershell -Command "
# Set the timeout duration (in seconds)
$Timeout = 30
$RetryInterval = 1
$timer = [Diagnostics.Stopwatch]::StartNew()
`$Timeout = 30
`$RetryInterval = 1
`$timer = [Diagnostics.Stopwatch]::StartNew()
# Start the process
$process = Start-Process -FilePath conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -PassThru
`$process = Start-Process -FilePath conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -PassThru
# Monitor the process
while (($timer.Elapsed.TotalSeconds -lt $Timeout) -and (-not $process.HasExited)) {
Start-Sleep -Seconds $RetryInterval
$totalSecs = [math]::Round($timer.Elapsed.TotalSeconds, 0)
Write-Host \"Still waiting for $PKG installation... [$totalSecs seconds elapsed]\"
while ((`$timer.Elapsed.TotalSeconds -lt `$Timeout) -and (-not `$process.HasExited)) {
Start-Sleep -Seconds `$RetryInterval
`$totalSecs = [math]::Round(`$timer.Elapsed.TotalSeconds, 0)
Write-Host \"Still waiting for $PKG installation... [`$totalSecs seconds elapsed]\"
}
$timer.Stop()
`$timer.Stop()
if (-not $process.HasExited) {
Stop-Process -Id $process.Id -Force
Write-Host \"WARNING: $PKG installation timed out after $Timeout seconds\"
} elseif ($process.ExitCode -ne 0) {
Write-Host \"WARNING: $PKG installation failed with exit code $($process.ExitCode)\"
if (-not `$process.HasExited) {
Stop-Process -Id `$process.Id -Force
Write-Host \"WARNING: $PKG installation timed out after `$Timeout seconds\"
} elseif (`$process.ExitCode -ne 0) {
Write-Host \"WARNING: $PKG installation failed with exit code `$(`$process.ExitCode)\"
} else {
Write-Host \"SUCCESS: $PKG installed successfully\"
}
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,24 +423,26 @@ jobs:
if [[ "${{matrix.TARGET}}" == win ]]; then
powershell -Command "
# Set the timeout duration (in seconds)
$Timeout = 30
$RetryInterval = 1
$timer = [Diagnostics.Stopwatch]::StartNew()
`$Timeout = 30
`$RetryInterval = 1
`$timer = [Diagnostics.Stopwatch]::StartNew()
# Start the process
$process = Start-Process -FilePath conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -PassThru
`$process = Start-Process -FilePath conda -ArgumentList 'install', '-q', '-y', '$PKG' -NoNewWindow -PassThru
# Monitor the process
while (($timer.Elapsed.TotalSeconds -lt $Timeout) -and (-not $process.HasExited)) {
Start-Sleep -Seconds $RetryInterval
$totalSecs = [math]::Round($timer.Elapsed.TotalSeconds, 0)
Write-Host \"Still waiting for $PKG installation... [$totalSecs seconds elapsed]\"
while ((`$timer.Elapsed.TotalSeconds -lt `$Timeout) -and (-not `$process.HasExited)) {
Start-Sleep -Seconds `$RetryInterval
`$totalSecs = [math]::Round(`$timer.Elapsed.TotalSeconds, 0)
Write-Host \"Still waiting for $PKG installation... [`$totalSecs seconds elapsed]\"
}
$timer.Stop()
`$timer.Stop()
if (-not $process.HasExited) {
Stop-Process -Id $process.Id -Force
Write-Host \"WARNING: $PKG installation timed out after $Timeout seconds\"
} elseif ($process.ExitCode -ne 0) {
Write-Host \"WARNING: $PKG installation failed with exit code $($process.ExitCode)\"
if (-not `$process.HasExited) {
Stop-Process -Id `$process.Id -Force
Write-Host \"WARNING: $PKG installation timed out after `$Timeout seconds\"
} elseif (`$process.ExitCode -ne 0) {
Write-Host \"WARNING: $PKG installation failed with exit code `$(`$process.ExitCode)\"
} else {
Write-Host \"SUCCESS: $PKG installed successfully\"
}
Expand Down

0 comments on commit 3a87f3d

Please sign in to comment.