Compare commits

..

3 Commits

Author SHA1 Message Date
aparnajyothi-y
04cc07025b Update Node.Tests.ps1 2024-07-08 17:01:08 +05:30
aparnajyothi-y
f6400f0d5f Update Node.Tests.ps1 2024-07-08 17:00:33 +05:30
gowridurgad
e996a46d44 Update Node.Tests.ps1 2024-06-28 16:28:06 +05:30
3 changed files with 11 additions and 2651 deletions

View File

@@ -1,7 +1,7 @@
name: Get Node versions name: Get Node versions
on: on:
schedule: schedule:
- cron: '0 0,12 * * *' - cron: '0 3,15 * * *'
workflow_dispatch: workflow_dispatch:
jobs: jobs:

View File

@@ -6,41 +6,15 @@ Describe "Node.js" {
BeforeAll { BeforeAll {
function Get-UseNodeLogs { function Get-UseNodeLogs {
$runnerProc = Get-Process -Name "Runner.Listener" -ErrorAction SilentlyContinue | Select-Object -First 1 # GitHub Windows images don't have `HOME` variable
#Write-Host "`$runnerProc: $($runnerProc | Out-String)" $homeDir = $env:HOME ?? $env:HOMEDRIVE
if (-not $runnerProc -or -not $runnerProc.Path) { $logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
Write-Error "Runner.Listener process not found."
return
}
# Go up two directories to get runner root
$runnerRoot = Split-Path (Split-Path $runnerProc.Path -Parent) -Parent
#Write-Host "`$runnerRoot: $runnerRoot"
# Recursively find all _diag/pages folders under the runner root directory
$possiblePaths = Get-ChildItem -Path $runnerRoot -Directory -Recurse -Depth 4 -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*_diag\pages" -or $_.FullName -like "*_diag/pages" }
Write-Host "LogsPaths:"
$possiblePaths | ForEach-Object { Write-Host $_.FullName }
$logsFolderPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1 $useNodeLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object {
if ($logsFolderPath) { $logContent = Get-Content $_.Fullname -Raw
$resolvedPath = Resolve-Path -Path $logsFolderPath -ErrorAction SilentlyContinue return $logContent -match "setup-node@v"
} } | Select-Object -First 1
return $useNodeLogFile.Fullname
if ($resolvedPath -and -not [string]::IsNullOrEmpty($resolvedPath.Path) -and (Test-Path $resolvedPath.Path)) {
$useNodeLogFile = Get-ChildItem -Path $resolvedPath | Where-Object {
$logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-node@v"
} | Select-Object -First 1
# Return the file name if a match is found
if ($useNodeLogFile) {
return $useNodeLogFile.FullName
} else {
Write-Error "No matching log file found in the specified path: $($resolvedPath.Path)"
}
} else {
Write-Error "The provided logs folder path is null, empty, or does not exist: $logsFolderPath"
}
} }
} }

File diff suppressed because it is too large Load Diff