Skip to content

Commit 1e798af

Browse files
authored
Update build-test-windows.yml
1 parent bae52ef commit 1e798af

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/build-test-windows.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,26 @@ jobs:
2323
- name: Monitor _temp folder and copy setup.ps1
2424
shell: powershell
2525
run: |
26-
# Ensure debug folder exists
2726
$debugFolder = "C:\GitHubActionsRunner\debug"
2827
if (!(Test-Path -Path $debugFolder)) {
2928
New-Item -ItemType Directory -Path $debugFolder
3029
}
31-
32-
# Monitor _temp folder for setup.ps1 and copy it as soon as it appears
33-
$tempFolder = "C:\GitHubActionsRunner\_work\_temp"
34-
$fileCopied = $false
35-
while (-not $fileCopied) {
36-
if (Test-Path -Path "$tempFolder\setup.ps1") {
37-
Copy-Item -Path "$tempFolder\setup.ps1" -Destination "$debugFolder" -Force
38-
Write-Output "setup.ps1 copied to debug folder."
39-
$fileCopied = $true
30+
31+
Start-Job -ScriptBlock {
32+
$tempFolder = "C:\GitHubActionsRunner\_work\_temp"
33+
$debugFolder = "C:\GitHubActionsRunner\debug"
34+
$fileCopied = $false
35+
36+
while (-not $fileCopied) {
37+
$setupFile = Get-ChildItem -Path $tempFolder -Recurse -Filter "setup.ps1" -ErrorAction SilentlyContinue | Select-Object -First 1
38+
39+
if ($setupFile) {
40+
Copy-Item -Path $setupFile.FullName -Destination $debugFolder -Force
41+
Write-Output "setup.ps1 copied to debug folder: $($setupFile.FullName)"
42+
$fileCopied = $true
43+
}
44+
Start-Sleep -Seconds 1
4045
}
41-
Start-Sleep -Seconds 1
4246
}
4347
4448
- name: Install Python

0 commit comments

Comments
 (0)