Compare commits

..

3 Commits

Author SHA1 Message Date
aparnajyothi-y
38ee237c8e Update Go.Tests.ps1 2024-07-09 15:32:50 +05:30
aparnajyothi-y
4856273f98 Update Go.Tests.ps1 2024-07-08 17:13:13 +05:30
aparnajyothi-y
749c9db345 Update Go.Tests.ps1 2024-06-28 17:47:38 +05:30
6 changed files with 13 additions and 1889 deletions

View File

@@ -28,4 +28,4 @@ jobs:
tool-name: "go"
tool-version: ${{ inputs.VERSION || '1.19.0' }}
publish-release: ${{ inputs.PUBLISH_RELEASES || false }}
secrets: inherit
secrets: inherit

View File

@@ -13,4 +13,4 @@ jobs:
name: CodeQL analysis
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
with:
languages: '["go"]'
languages: "['go']"

View File

@@ -1,7 +1,7 @@
name: Get Go versions
on:
schedule:
- cron: '0 0,12 * * *'
- cron: '0 3,15 * * *'
workflow_dispatch:
jobs:
@@ -10,4 +10,4 @@ jobs:
with:
tool-name: "Go"
image-url: "https://go.dev/images/gopher-footer.jpg"
secrets: inherit
secrets: inherit

View File

@@ -66,7 +66,7 @@ class GoBuilder {
$filename = "$goVersion.$goPlatform-$arch.$ArchiveType"
return "https://go.dev/dl/$filename"
return "https://storage.googleapis.com/golang/$filename"
}
[string] Download() {

View File

@@ -8,42 +8,15 @@ Describe "Go" {
$sourceLocation = Get-Location
function Get-UseGoLogs {
$runnerProc = Get-Process -Name "Runner.Listener" -ErrorAction SilentlyContinue | Select-Object -First 1
#Write-Host "`$runnerProc: $($runnerProc | Out-String)"
if (-not $runnerProc -or -not $runnerProc.Path) {
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
if ($logsFolderPath) {
$resolvedPath = Resolve-Path -Path $logsFolderPath -ErrorAction SilentlyContinue
}
# GitHub Windows images don't have `HOME` variable
$homeDir = $env:HOME ?? $env:HOMEDRIVE
$logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
if ($resolvedPath -and -not [string]::IsNullOrEmpty($resolvedPath.Path) -and (Test-Path $resolvedPath.Path)) {
$useGoLogFile = Get-ChildItem -Path $resolvedPath | Where-Object {
$logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-go@v"
} | Select-Object -First 1
# Return the file name if a match is found
if ($useGoLogFile) {
return $useGoLogFile.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"
}
$useGoLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object {
$logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-go@v"
} | Select-Object -First 1
return $useGoLogFile.Fullname
}
}

File diff suppressed because it is too large Load Diff