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 9 additions and 1928 deletions

View File

@@ -23,7 +23,7 @@ on:
jobs: jobs:
node: node:
name: Node name: Node
uses: actions/versions-package-tools/.github/workflows/build-tool-packages.yml@test-macos-x64-runner uses: actions/versions-package-tools/.github/workflows/build-tool-packages.yml@main
with: with:
tool-name: "node" tool-name: "node"
tool-version: ${{ inputs.VERSION || '18.12.0' }} tool-version: ${{ inputs.VERSION || '18.12.0' }}

View File

@@ -8,30 +8,13 @@ Describe "Node.js" {
function Get-UseNodeLogs { function Get-UseNodeLogs {
# GitHub Windows images don't have `HOME` variable # GitHub Windows images don't have `HOME` variable
$homeDir = $env:HOME ?? $env:HOMEDRIVE $homeDir = $env:HOME ?? $env:HOMEDRIVE
$logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
$possiblePaths = @( $useNodeLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object {
Join-Path -Path $homeDir -ChildPath "actions-runner/cached/_diag/pages"
Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages"
)
$logsFolderPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1
$resolvedPath = Resolve-Path -Path $logsFolderPath -ErrorAction SilentlyContinue
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 $logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-node@v" return $logContent -match "setup-node@v"
} | Select-Object -First 1 } | Select-Object -First 1
return $useNodeLogFile.Fullname
# 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